summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/restore/restore.c12
-rw-r--r--sbin/restore/utilities.c16
-rw-r--r--sbin/ttyflags/ttyflags.c32
-rw-r--r--usr.sbin/inetd/inetd.c10
-rw-r--r--usr.sbin/pppd/chat/chat.c7
5 files changed, 39 insertions, 38 deletions
diff --git a/sbin/restore/restore.c b/sbin/restore/restore.c
index a05abf8404d..28afa13f237 100644
--- a/sbin/restore/restore.c
+++ b/sbin/restore/restore.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: restore.c,v 1.7 2002/02/16 21:27:37 millert Exp $ */
+/* $OpenBSD: restore.c,v 1.8 2002/05/29 19:23:34 deraadt Exp $ */
/* $NetBSD: restore.c,v 1.9 1997/06/18 07:10:16 lukem Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)restore.c 8.3 (Berkeley) 9/13/94";
#else
-static char rcsid[] = "$OpenBSD: restore.c,v 1.7 2002/02/16 21:27:37 millert Exp $";
+static char rcsid[] = "$OpenBSD: restore.c,v 1.8 2002/05/29 19:23:34 deraadt Exp $";
#endif
#endif /* not lint */
@@ -515,13 +515,13 @@ keyval(key)
(void)strcpy(keybuf, "|NIL");
keybuf[0] = '\0';
if (key & ONTAPE)
- (void)strcat(keybuf, "|ONTAPE");
+ (void)strlcat(keybuf, "|ONTAPE", sizeof keybuf);
if (key & INOFND)
- (void)strcat(keybuf, "|INOFND");
+ (void)strlcat(keybuf, "|INOFND", sizeof keybuf);
if (key & NAMEFND)
- (void)strcat(keybuf, "|NAMEFND");
+ (void)strlcat(keybuf, "|NAMEFND", sizeof keybuf);
if (key & MODECHG)
- (void)strcat(keybuf, "|MODECHG");
+ (void)strlcat(keybuf, "|MODECHG", sizeof keybuf);
return (&keybuf[1]);
}
diff --git a/sbin/restore/utilities.c b/sbin/restore/utilities.c
index eb7100caedf..273e4ce1ad4 100644
--- a/sbin/restore/utilities.c
+++ b/sbin/restore/utilities.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utilities.c,v 1.9 2002/02/23 21:18:11 deraadt Exp $ */
+/* $OpenBSD: utilities.c,v 1.10 2002/05/29 19:23:34 deraadt Exp $ */
/* $NetBSD: utilities.c,v 1.11 1997/03/19 08:42:56 lukem Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)utilities.c 8.4 (Berkeley) 10/18/94";
#else
-static char rcsid[] = "$OpenBSD: utilities.c,v 1.9 2002/02/23 21:18:11 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: utilities.c,v 1.10 2002/05/29 19:23:34 deraadt Exp $";
#endif
#endif /* not lint */
@@ -348,17 +348,17 @@ flagvalues(ep)
(void)strcpy(flagbuf, "|NIL");
flagbuf[0] = '\0';
if (ep->e_flags & REMOVED)
- (void)strcat(flagbuf, "|REMOVED");
+ (void)strlcat(flagbuf, "|REMOVED", sizeof flagbuf);
if (ep->e_flags & TMPNAME)
- (void)strcat(flagbuf, "|TMPNAME");
+ (void)strlcat(flagbuf, "|TMPNAME", sizeof flagbuf);
if (ep->e_flags & EXTRACT)
- (void)strcat(flagbuf, "|EXTRACT");
+ (void)strlcat(flagbuf, "|EXTRACT", sizeof flagbuf);
if (ep->e_flags & NEW)
- (void)strcat(flagbuf, "|NEW");
+ (void)strlcat(flagbuf, "|NEW", sizeof flagbuf);
if (ep->e_flags & KEEP)
- (void)strcat(flagbuf, "|KEEP");
+ (void)strlcat(flagbuf, "|KEEP", sizeof flagbuf);
if (ep->e_flags & EXISTED)
- (void)strcat(flagbuf, "|EXISTED");
+ (void)strlcat(flagbuf, "|EXISTED", sizeof flagbuf);
return (&flagbuf[1]);
}
diff --git a/sbin/ttyflags/ttyflags.c b/sbin/ttyflags/ttyflags.c
index 138100472c4..f30574fec65 100644
--- a/sbin/ttyflags/ttyflags.c
+++ b/sbin/ttyflags/ttyflags.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttyflags.c,v 1.8 2002/02/16 21:27:38 millert Exp $ */
+/* $OpenBSD: ttyflags.c,v 1.9 2002/05/29 19:23:34 deraadt Exp $ */
/* $NetBSD: ttyflags.c,v 1.8 1996/04/09 05:20:30 cgd Exp $ */
/*
@@ -39,7 +39,7 @@ char copyright[] =
#endif /* not lint */
#ifndef lint
-static char rcsid[] = "$OpenBSD: ttyflags.c,v 1.8 2002/02/16 21:27:38 millert Exp $";
+static char rcsid[] = "$OpenBSD: ttyflags.c,v 1.9 2002/05/29 19:23:34 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -183,26 +183,26 @@ ttyflags(tep, print)
/* Convert ttyent.h flags into ioctl flags. */
if (st & TTY_LOCAL) {
flags |= TIOCFLAG_CLOCAL;
- (void)strcat(strflags, "local");
+ (void)strlcat(strflags, "local", sizeof strflags);
sep++;
}
if (st & TTY_RTSCTS) {
flags |= TIOCFLAG_CRTSCTS;
if (sep++)
- (void)strcat(strflags, "|");
- (void)strcat(strflags, "rtscts");
+ (void)strlcat(strflags, "|", sizeof strflags);
+ (void)strlcat(strflags, "rtscts", sizeof strflags);
}
if (st & TTY_SOFTCAR) {
flags |= TIOCFLAG_SOFTCAR;
if (sep++)
- (void)strcat(strflags, "|");
- (void)strcat(strflags, "softcar");
+ (void)strlcat(strflags, "|", sizeof strflags);
+ (void)strlcat(strflags, "softcar", sizeof strflags);
}
if (st & TTY_MDMBUF) {
flags |= TIOCFLAG_MDMBUF;
if (sep++)
- (void)strcat(strflags, "|");
- (void)strcat(strflags, "mdmbuf");
+ (void)strlcat(strflags, "|", sizeof strflags);
+ (void)strlcat(strflags, "mdmbuf", sizeof strflags);
}
if (vflag)
printf("%s setting flags to: %s\n", path, strflags);
@@ -233,23 +233,23 @@ ttyflags(tep, print)
rval = (errno != ENOTTY);
}
if (flags & TIOCFLAG_CLOCAL) {
- (void)strcat(strflags, "local");
+ (void)strlcat(strflags, "local", sizeof strflags);
sep++;
}
if (flags & TIOCFLAG_CRTSCTS) {
if (sep++)
- (void)strcat(strflags, "|");
- (void)strcat(strflags, "rtscts");
+ (void)strlcat(strflags, "|", sizeof strflags);
+ (void)strlcat(strflags, "rtscts", sizeof strflags);
}
if (flags & TIOCFLAG_SOFTCAR) {
if (sep++)
- (void)strcat(strflags, "|");
- (void)strcat(strflags, "softcar");
+ (void)strlcat(strflags, "|", sizeof strflags);
+ (void)strlcat(strflags, "softcar", sizeof strflags);
}
if (flags & TIOCFLAG_MDMBUF) {
if (sep++)
- (void)strcat(strflags, "|");
- (void)strcat(strflags, "mdmbuf");
+ (void)strlcat(strflags, "|", sizeof strflags);
+ (void)strlcat(strflags, "mdmbuf", sizeof strflags);
}
printf("%s flags are: %s\n", path, strflags);
}
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index 0611971dc9e..ebd66e22fef 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inetd.c,v 1.91 2002/05/26 09:25:21 deraadt Exp $ */
+/* $OpenBSD: inetd.c,v 1.92 2002/05/29 19:23:34 deraadt Exp $ */
/* $NetBSD: inetd.c,v 1.11 1996/02/22 11:14:41 mycroft Exp $ */
/*
* Copyright (c) 1983,1991 The Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)inetd.c 5.30 (Berkeley) 6/3/91";*/
-static char rcsid[] = "$OpenBSD: inetd.c,v 1.91 2002/05/26 09:25:21 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: inetd.c,v 1.92 2002/05/29 19:23:34 deraadt Exp $";
#endif /* not lint */
/*
@@ -1725,9 +1725,9 @@ inetd_setproctitle(a, s)
char *s = inet_ntoa(sin.sin_addr);
buf[sizeof(buf) - 1 - strlen(s) - 3] = '\0';
- strcat(buf, " [");
- strcat(buf, s);
- strcat(buf, "]");
+ strlcat(buf, " [", sizeof buf);
+ strlcat(buf, s, sizeof buf);
+ strlcat(buf, "]", sizeof buf);
}
strncpy(cp, buf, LastArg - cp);
cp += strlen(cp);
diff --git a/usr.sbin/pppd/chat/chat.c b/usr.sbin/pppd/chat/chat.c
index 2e15eb6d3de..c04dbc56686 100644
--- a/usr.sbin/pppd/chat/chat.c
+++ b/usr.sbin/pppd/chat/chat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chat.c,v 1.16 2002/02/19 19:39:40 millert Exp $ */
+/* $OpenBSD: chat.c,v 1.17 2002/05/29 19:23:34 deraadt Exp $ */
/*
* Chat -- a program for automatic session establishment (i.e. dial
@@ -83,7 +83,7 @@
#if 0
static char rcsid[] = "Id: chat.c,v 1.19 1998/03/24 23:57:48 paulus Exp $";
#else
-static char rcsid[] = "$OpenBSD: chat.c,v 1.16 2002/02/19 19:39:40 millert Exp $";
+static char rcsid[] = "$OpenBSD: chat.c,v 1.17 2002/05/29 19:23:34 deraadt Exp $";
#endif
#endif
@@ -1398,7 +1398,8 @@ register char *string;
alarm(0);
alarmed = 0;
exit_code = n + 4;
- strcpy(fail_reason = fail_buffer, abort_string[n]);
+ strlcpy(fail_buffer, abort_string[n], sizeof fail_buffer);
+ fail_reason = fail_buffer;
return (0);
}
}