summaryrefslogtreecommitdiff
path: root/libexec/tcpd
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/tcpd')
-rw-r--r--libexec/tcpd/tcpd/tcpd.c8
-rw-r--r--libexec/tcpd/tcpdchk/inetcf.c8
-rw-r--r--libexec/tcpd/tcpdchk/scaffold.c6
-rw-r--r--libexec/tcpd/tcpdchk/tcpdchk.c10
4 files changed, 16 insertions, 16 deletions
diff --git a/libexec/tcpd/tcpd/tcpd.c b/libexec/tcpd/tcpd/tcpd.c
index d91d9487411..fe0271d9570 100644
--- a/libexec/tcpd/tcpd/tcpd.c
+++ b/libexec/tcpd/tcpd/tcpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcpd.c,v 1.1 1997/02/26 06:17:05 downsj Exp $ */
+/* $OpenBSD: tcpd.c,v 1.2 2002/07/30 22:27:20 deraadt Exp $ */
/*
* General front end for stream and datagram IP services. This program logs
@@ -16,7 +16,7 @@
#if 0
static char sccsid[] = "@(#) tcpd.c 1.10 96/02/11 17:01:32";
#else
-static char rcsid[] = "$OpenBSD: tcpd.c,v 1.1 1997/02/26 06:17:05 downsj Exp $";
+static char rcsid[] = "$OpenBSD: tcpd.c,v 1.2 2002/07/30 22:27:20 deraadt Exp $";
#endif
#endif
@@ -66,10 +66,10 @@ char **argv;
*/
if (argv[0][0] == '/') {
- strcpy(path, argv[0]);
+ strlcpy(path, argv[0], sizeof path);
argv[0] = strrchr(argv[0], '/') + 1;
} else {
- sprintf(path, "%s/%s", REAL_DAEMON_DIR, argv[0]);
+ snprintf(path, sizeof path, "%s/%s", REAL_DAEMON_DIR, argv[0]);
}
/*
diff --git a/libexec/tcpd/tcpdchk/inetcf.c b/libexec/tcpd/tcpdchk/inetcf.c
index c2ebf5307ea..370a6650668 100644
--- a/libexec/tcpd/tcpdchk/inetcf.c
+++ b/libexec/tcpd/tcpdchk/inetcf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inetcf.c,v 1.1 1997/02/26 06:17:07 downsj Exp $ */
+/* $OpenBSD: inetcf.c,v 1.2 2002/07/30 22:27:20 deraadt Exp $ */
/*
* Routines to parse an inetd.conf or tlid.conf file. This would be a great
@@ -11,7 +11,7 @@
#if 0
static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02:13:23";
#else
-static char rcsid[] = "$OpenBSD: inetcf.c,v 1.1 1997/02/26 06:17:07 downsj Exp $";
+static char rcsid[] = "$OpenBSD: inetcf.c,v 1.2 2002/07/30 22:27:20 deraadt Exp $";
#endif
#endif
@@ -235,7 +235,7 @@ char *arg1;
tcpd_warn("%s: not executable", arg0);
}
} else { /* look in REAL_DAEMON_DIR */
- sprintf(daemon, "%s/%s", REAL_DAEMON_DIR, arg0);
+ snprintf(daemon, sizeof daemon, "%s/%s", REAL_DAEMON_DIR, arg0);
if (check_path(daemon, &st) < 0) {
tcpd_warn("%s: not found in %s: %m",
arg0, REAL_DAEMON_DIR);
@@ -251,7 +251,7 @@ char *arg1;
* recipe. Look for a file with the same basename in REAL_DAEMON_DIR.
* Draw some conservative conclusions when a distinct file is found.
*/
- sprintf(daemon, "%s/%s", REAL_DAEMON_DIR, arg0);
+ snprintf(daemon, sizeof daemon, "%s/%s", REAL_DAEMON_DIR, arg0);
if (STR_EQ(path, daemon)) {
wrap_status = WR_NOT;
} else if (check_path(daemon, &st) >= 0) {
diff --git a/libexec/tcpd/tcpdchk/scaffold.c b/libexec/tcpd/tcpdchk/scaffold.c
index 582cea1d173..da0467d383b 100644
--- a/libexec/tcpd/tcpdchk/scaffold.c
+++ b/libexec/tcpd/tcpdchk/scaffold.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scaffold.c,v 1.6 2002/06/07 03:32:04 itojun Exp $ */
+/* $OpenBSD: scaffold.c,v 1.7 2002/07/30 22:27:20 deraadt Exp $ */
/*
* Routines for testing only. Not really industrial strength.
@@ -10,7 +10,7 @@
#if 0
static char sccs_id[] = "@(#) scaffold.c 1.5 95/01/03 09:13:48";
#else
-static char rcsid[] = "$OpenBSD: scaffold.c,v 1.6 2002/06/07 03:32:04 itojun Exp $";
+static char rcsid[] = "$OpenBSD: scaffold.c,v 1.7 2002/07/30 22:27:20 deraadt Exp $";
#endif
#endif
@@ -159,7 +159,7 @@ struct stat *st;
if (st->st_mode & 002)
tcpd_warn("%s: world writable", path);
if (path[0] == '/' && path[1] != 0) {
- strrchr(strcpy(buf, path), '/')[0] = 0;
+ strrchr((strlcpy(buf, path, sizeof buf), buf), '/')[0] = 0;
(void) check_path(buf[0] ? buf : "/", &stbuf);
}
return (0);
diff --git a/libexec/tcpd/tcpdchk/tcpdchk.c b/libexec/tcpd/tcpdchk/tcpdchk.c
index ebe74dafcc7..3e3353d2ba4 100644
--- a/libexec/tcpd/tcpdchk/tcpdchk.c
+++ b/libexec/tcpd/tcpdchk/tcpdchk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcpdchk.c,v 1.6 2002/06/07 03:32:04 itojun Exp $ */
+/* $OpenBSD: tcpdchk.c,v 1.7 2002/07/30 22:27:20 deraadt Exp $ */
/*
* tcpdchk - examine all tcpd access control rules and inetd.conf entries
@@ -20,7 +20,7 @@
#if 0
static char sccsid[] = "@(#) tcpdchk.c 1.8 97/02/12 02:13:25";
#else
-static char rcsid[] = "$OpenBSD: tcpdchk.c,v 1.6 2002/06/07 03:32:04 itojun Exp $";
+static char rcsid[] = "$OpenBSD: tcpdchk.c,v 1.7 2002/07/30 22:27:20 deraadt Exp $";
#endif
#endif
@@ -287,7 +287,7 @@ char *list;
char *next;
fputs(title, stdout);
- strcpy(buf, list);
+ strlcpy(buf, list, sizeof buf);
for (cp = strtok(buf, sep); cp != 0; cp = next) {
fputs(cp, stdout);
@@ -308,7 +308,7 @@ char *list;
char *host;
int daemons = 0;
- strcpy(buf, list);
+ strlcpy(buf, list, sizeof buf);
for (cp = strtok(buf, sep); cp != 0; cp = strtok((char *) 0, sep)) {
if (STR_EQ(cp, "EXCEPT")) {
@@ -339,7 +339,7 @@ char *list;
int l;
#endif
- strcpy(buf, list);
+ strlcpy(buf, list, sizeof buf);
for (cp = strtok(buf, sep); cp != 0; cp = strtok((char *) 0, sep)) {
#ifdef INET6