summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/lpd
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-11-27 17:24:28 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-11-27 17:24:28 +0000
commit5256124178086924d4cb31e85c8726d626a331f4 (patch)
tree627d285e27ff5d354c948f2e306fa3c7111e7678 /usr.sbin/lpr/lpd
parent95a0d5d5158b3b220c97680a0f84a8d966858d61 (diff)
Fix check for '/' in cf file and change the check for '/' in df file
for consistency. Based on a patch from Sebastian Krahmer.
Diffstat (limited to 'usr.sbin/lpr/lpd')
-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;
}