summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2001-11-27 17:24:27 +0000
committermillert <millert@openbsd.org>2001-11-27 17:24:27 +0000
commit6d4674c4df646c62d571d1ce120cb6a7fb0e7b5b (patch)
tree88f2d43bc556c3f1d60330ae792d6eb2991aff12
parentWhen copying command line arguments to out new argument vector, (diff)
downloadwireguard-openbsd-6d4674c4df646c62d571d1ce120cb6a7fb0e7b5b.tar.xz
wireguard-openbsd-6d4674c4df646c62d571d1ce120cb6a7fb0e7b5b.zip
Fix check for '/' in cf file and change the check for '/' in df file
for consistency. Based on a patch from Sebastian Krahmer.
-rw-r--r--usr.sbin/lpr/lpd/recvjob.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.sbin/lpr/lpd/recvjob.c b/usr.sbin/lpr/lpd/recvjob.c
index 3acadebfc7d..490485d3142 100644
--- a/usr.sbin/lpr/lpd/recvjob.c
+++ b/usr.sbin/lpr/lpd/recvjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: recvjob.c,v 1.16 2001/11/19 20:27:14 deraadt Exp $ */
+/* $OpenBSD: recvjob.c,v 1.17 2001/11/27 17:24:27 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -44,7 +44,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95";
#else
-static const char rcsid[] = "$OpenBSD: recvjob.c,v 1.16 2001/11/19 20:27:14 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: recvjob.c,v 1.17 2001/11/27 17:24:27 millert Exp $";
#endif
#endif /* not lint */
@@ -180,11 +180,10 @@ readjob()
* returns
*/
strlcpy(cp + 6, from, sizeof(line) + line - cp - 6);
+ if (strchr(cp, '/'))
+ frecverr("readjob: %s: illegal path name", cp);
strlcpy(tfname, cp, sizeof tfname);
tfname[0] = 't';
- if (strchr(tfname, '/'))
- frecverr("readjob: %s: illegal path name",
- tfname);
if (!chksize(size)) {
(void) write(1, "\2", 1);
continue;
@@ -206,14 +205,13 @@ readjob()
size = size * 10 + (*cp++ - '0');
if (*cp++ != ' ')
break;
+ if (strchr(cp, '/'))
+ frecverr("readjob: %s: illegal path name", cp);
if (!chksize(size)) {
(void) write(1, "\2", 1);
continue;
}
(void) strlcpy(dfname, cp, sizeof dfname);
- if (strchr(dfname, '/'))
- frecverr("readjob: %s: illegal path name",
- dfname);
(void) readfile(dfname, size);
continue;
}