recvjob.c (80171) | recvjob.c (87375) |
---|---|
1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 29 unchanged lines hidden (view full) --- 38 The Regents of the University of California. All rights reserved.\n"; 39#endif /* not lint */ 40 41#ifndef lint 42#if 0 43static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95"; 44#endif 45static const char rcsid[] = | 1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 29 unchanged lines hidden (view full) --- 38 The Regents of the University of California. All rights reserved.\n"; 39#endif /* not lint */ 40 41#ifndef lint 42#if 0 43static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95"; 44#endif 45static const char rcsid[] = |
46 "$FreeBSD: head/usr.sbin/lpr/lpd/recvjob.c 80171 2001-07-23 00:15:37Z gad $"; | 46 "$FreeBSD: head/usr.sbin/lpr/lpd/recvjob.c 87375 2001-12-05 02:07:20Z gad $"; |
47#endif /* not lint */ 48 49/* 50 * Receive printer jobs from the network, queue them and 51 * start the printer daemon. 52 */ 53#include <sys/param.h> 54#include <sys/mount.h> --- 134 unchanged lines hidden (view full) --- 189 /* 190 * host name has been authenticated, we use our 191 * view of the host name since we may be passed 192 * something different than what gethostbyaddr() 193 * returns 194 */ 195 strlcpy(cp + 6, from_host, sizeof(line) 196 + (size_t)(line - cp - 6)); | 47#endif /* not lint */ 48 49/* 50 * Receive printer jobs from the network, queue them and 51 * start the printer daemon. 52 */ 53#include <sys/param.h> 54#include <sys/mount.h> --- 134 unchanged lines hidden (view full) --- 189 /* 190 * host name has been authenticated, we use our 191 * view of the host name since we may be passed 192 * something different than what gethostbyaddr() 193 * returns 194 */ 195 strlcpy(cp + 6, from_host, sizeof(line) 196 + (size_t)(line - cp - 6)); |
197 if (strchr(cp, '/')) { 198 frecverr("readjob: %s: illegal path name", cp); 199 /*NOTREACHED*/ 200 } |
|
197 strlcpy(tfname, cp, sizeof(tfname)); 198 tfname[sizeof (tfname) - 1] = '\0'; 199 tfname[0] = 't'; | 201 strlcpy(tfname, cp, sizeof(tfname)); 202 tfname[sizeof (tfname) - 1] = '\0'; 203 tfname[0] = 't'; |
200 if (strchr(tfname, '/')) 201 frecverr("readjob: %s: illegal path name", 202 tfname); | |
203 if (!chksize(size)) { 204 (void) write(STDOUT_FILENO, "\2", (size_t)1); 205 continue; 206 } 207 if (!readfile(pp, tfname, (size_t)size)) { 208 rcleanup(0); 209 continue; 210 } --- 9 unchanged lines hidden (view full) --- 220 case '\3': /* read df file */ 221 *givenid = '\0'; 222 *givenhost = '\0'; 223 size = 0; 224 while (*cp >= '0' && *cp <= '9') 225 size = size * 10 + (*cp++ - '0'); 226 if (*cp++ != ' ') 227 break; | 204 if (!chksize(size)) { 205 (void) write(STDOUT_FILENO, "\2", (size_t)1); 206 continue; 207 } 208 if (!readfile(pp, tfname, (size_t)size)) { 209 rcleanup(0); 210 continue; 211 } --- 9 unchanged lines hidden (view full) --- 221 case '\3': /* read df file */ 222 *givenid = '\0'; 223 *givenhost = '\0'; 224 size = 0; 225 while (*cp >= '0' && *cp <= '9') 226 size = size * 10 + (*cp++ - '0'); 227 if (*cp++ != ' ') 228 break; |
229 if (strchr(cp, '/')) { 230 frecverr("readjob: %s: illegal path name", cp); 231 /*NOTREACHED*/ 232 } |
|
228 if (!chksize(size)) { 229 (void) write(STDOUT_FILENO, "\2", (size_t)1); 230 continue; 231 } 232 strlcpy(dfname, cp, sizeof(dfname)); | 233 if (!chksize(size)) { 234 (void) write(STDOUT_FILENO, "\2", (size_t)1); 235 continue; 236 } 237 strlcpy(dfname, cp, sizeof(dfname)); |
233 if (strchr(dfname, '/')) { 234 frecverr("readjob: %s: illegal path name", 235 dfname); 236 /*NOTREACHED*/ 237 } | |
238 dfcnt++; 239 trstat_init(pp, dfname, dfcnt); 240 (void) readfile(pp, dfname, (size_t)size); 241 trstat_write(pp, TR_RECVING, (size_t)size, givenid, 242 from_host, givenhost); 243 continue; 244 } 245 frecverr("protocol screwup: %s", line); --- 172 unchanged lines hidden --- | 238 dfcnt++; 239 trstat_init(pp, dfname, dfcnt); 240 (void) readfile(pp, dfname, (size_t)size); 241 trstat_write(pp, TR_RECVING, (size_t)size, givenid, 242 from_host, givenhost); 243 continue; 244 } 245 frecverr("protocol screwup: %s", line); --- 172 unchanged lines hidden --- |