Subject: bin/5058: `lpr -rs file' doesn't remove `file'
To: None <gnats-bugs@gnats.netbsd.org>
From: NAKAJIMA Yoshihiro <nakayosh@kcn.or.jp>
List: netbsd-bugs
Date: 02/24/1998 23:34:23
>Number: 5058
>Category: bin
>Synopsis: `lpr -rs file' doesn't remove `file'
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Feb 24 06:35:04 1998
>Last-Modified:
>Originator: NAKAJIMA Yoshihiro
>Organization:
>Release: NetBSD-current 98/02/23
>Environment:
System: NetBSD asura 1.3D NetBSD 1.3D (ASURA) #3: Tue Feb 24 21:15:07 JST 1998 nakayosh@asura:/usr/src/sys/arch/i386/compile/ASURA i386
>Description:
`lpr -rs file' doesn't remove `file'.
The above command makes `/var/spool/output/lpd/tfA*', including remove
command to lpd such as:
: U/home/nakayosh/tmp/file
But the following codes prevent to remove file:
: % cat -n src/usr.sbin/lpr/lpd/printjob.c | sed -n 501,504p
: 501 case 'U':
: 502 if (strchr(line+1, '/'))
: 503 continue;
: 504 (void)unlink(line+1);
>How-To-Repeat:
See above.
>Fix:
Back to the old codes:
diff -u src/usr.sbin/lpr/lpd/printjob.c.orig src/usr.sbin/lpr/lpd/printjob.c
--- src/usr.sbin/lpr/lpd/printjob.c.orig Tue Oct 21 00:00:04 1997
+++ src/usr.sbin/lpr/lpd/printjob.c Tue Feb 24 21:47:27 1998
@@ -499,8 +499,6 @@
continue;
case 'U':
- if (strchr(line+1, '/'))
- continue;
(void)unlink(line+1);
}
/*
>Audit-Trail:
>Unformatted: