target file, using the -s option, then can use a symlink to get to the file.
Add O_EXCL to the open of the spool file.
SCCS-vsn: usr.sbin/lpr/lpd/recvjob.c 5.13
-static char sccsid[] = "@(#)recvjob.c 5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)recvjob.c 5.13 (Berkeley) %G%";
register int i, j, amt;
int fd, err;
register int i, j, amt;
int fd, err;
- fd = open(file, O_WRONLY|O_CREAT, FILMOD);
+ fd = open(file, O_CREAT|O_EXECL|O_WRONLY, FILMOD);
+ frecverr("illegal path name");
if (fd < 0)
frecverr("%s: %m", file);
ack();
if (fd < 0)
frecverr("%s: %m", file);
ack();