diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-07-21 05:24:13 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-07-21 05:24:13 +0000 |
commit | 91f29d50a9eca872531a531a67ed73db5272e146 (patch) | |
tree | ff3a203fe248e1dd5c10de835d90ca68134cad91 /usr.sbin/lpr/lpd | |
parent | df7cc1fd6db5eb29c577586182285201400623e4 (diff) |
careful about unlink; oliver
Diffstat (limited to 'usr.sbin/lpr/lpd')
-rw-r--r-- | usr.sbin/lpr/lpd/printjob.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c index 58a3418b467..cae12d80bfb 100644 --- a/usr.sbin/lpr/lpd/printjob.c +++ b/usr.sbin/lpr/lpd/printjob.c @@ -1,4 +1,4 @@ -/* $OpenBSD: printjob.c,v 1.13 1997/07/20 19:04:34 deraadt Exp $ */ +/* $OpenBSD: printjob.c,v 1.14 1997/07/21 05:24:12 deraadt Exp $ */ /* $NetBSD: printjob.c,v 1.9.4.3 1996/07/12 22:31:39 jtc Exp $ */ /* @@ -497,6 +497,8 @@ pass2: continue; case 'U': + if (strchr(line+1, '/')) + continue; (void) unlink(line+1); } /* @@ -821,7 +823,7 @@ sendit(file) */ fseek(cfp, 0L, 0); while (getline(cfp)) - if (line[0] == 'U') + if (line[0] == 'U' && !strchr(line+1, '/')) (void) unlink(line+1); /* * clean-up in case another control file exists |