diff options
author | imp <imp@FreeBSD.org> | 1996-10-27 03:06:52 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1996-10-27 03:06:52 +0000 |
commit | 354a4db3b5ff4e1a474ecd6a53a6b494699bb7e5 (patch) | |
tree | 66221bf4a36b58f86dc5901d5b3fa62ac74e6013 /usr.sbin/lpr/lpc | |
parent | 45818699bea7c582d8a5554fabaa32c65e8385f8 (diff) | |
download | FreeBSD-src-354a4db3b5ff4e1a474ecd6a53a6b494699bb7e5.zip FreeBSD-src-354a4db3b5ff4e1a474ecd6a53a6b494699bb7e5.tar.gz |
lpc/cmds.c:
From NetBSD via OpenBSD to fix NetBSD PR #506
More descriptive message for printer status
(OpenBSD: 1.2)
Various warnings cleaned up (OpenBSD: 1.4)
lpc/lpc.c:
Various warnings cleaned up (OpenBSD: 1.3)
lpd/lpd.c:
Remove trailing blank lines (OpenBSD: 1.2)
Potential umask problem with creating /dev/printer
(OpenBSD: 1.4 and 1.5)
Ftp bounce attack (untested on FreeBSD)
(OpenBSD: 1.6, 1.8, 1.9)
Fencepost in strncpy
(OpenBSD: 1.6)
lpd/printjob.c:
Fix from freebsd for waiting for an exiting filter, that
appears not in the FreeBSD CVS tree.
(OpenBSD: 1.6)
lpd/recvjob.c:
Buffer overflow protection: use strncpy rather than strcpy.
(OpenBSD: 1.3)
lpr/lpr.c:
NetBSD change of return type for main()
(OpenBSD: 1.2)
Restrict time running as root
(OpenBSD: 1.7)
Use getcwd rather than getwd (from NetBSD)
Use snprintf rather than sprintf
(OpenBSD: 1.8)
Minor tweak to end of loop and buffer overflow sanity. card()
overflow already in FreeBSD
(OpenBSD: 1.9)
lptest/lptest.c:
void -> int return type of main, from NetBSD via OpenBSD
(OpenBSD: 1.2)
pac/pac.c:
void -> int return type of main, from NetBSD via OpenBSD
(OpenBSD: 1.3)
Obtained from: OpenBSD
Diffstat (limited to 'usr.sbin/lpr/lpc')
-rw-r--r-- | usr.sbin/lpr/lpc/cmds.c | 8 | ||||
-rw-r--r-- | usr.sbin/lpr/lpc/lpc.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/lpr/lpc/cmds.c b/usr.sbin/lpr/lpc/cmds.c index 84c6a4d..722e81b 100644 --- a/usr.sbin/lpr/lpc/cmds.c +++ b/usr.sbin/lpr/lpc/cmds.c @@ -277,7 +277,7 @@ sortq(a, b) d1 = (struct dirent **)a; d2 = (struct dirent **)b; - if (c1 = strcmp((*d1)->d_name + 3, (*d2)->d_name + 3)) + if ((c1 = strcmp((*d1)->d_name + 3, (*d2)->d_name + 3))) return(c1); c1 = (*d1)->d_name[0]; c2 = (*d2)->d_name[0]; @@ -305,7 +305,7 @@ cleanpr() SD = _PATH_DEFSPOOL; printf("%s:\n", printer); - for (lp = line, cp = SD; *lp++ = *cp++; ) + for (lp = line, cp = SD; (*lp++ = *cp++); ) ; lp[-1] = '/'; @@ -592,7 +592,7 @@ putmsg(argc, argv) cp1 = buf; while (--argc >= 0) { cp2 = *argv++; - while (*cp1++ = *cp2++) + while ((*cp1++ = *cp2++)) ; cp1[-1] = ' '; } @@ -815,7 +815,7 @@ prstat() fd = open(line, O_RDONLY); if (fd < 0 || flock(fd, LOCK_SH|LOCK_NB) == 0) { (void) close(fd); /* unlocks as well */ - printf("\tno daemon present\n"); + printf("\tprinter idle\n"); return; } (void) close(fd); diff --git a/usr.sbin/lpr/lpc/lpc.c b/usr.sbin/lpr/lpc/lpc.c index f2938a6..5135163 100644 --- a/usr.sbin/lpr/lpc/lpc.c +++ b/usr.sbin/lpr/lpc/lpc.c @@ -178,7 +178,7 @@ getcmd(name) longest = 0; nmatches = 0; found = 0; - for (c = cmdtab; p = c->c_name; c++) { + for (c = cmdtab; (p = c->c_name); c++) { for (q = name; *q == *p++; q++) if (*q == 0) /* exact match? */ return(c); |