summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/lpr/lpd/recvjob.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/lpr/lpd/recvjob.c b/usr.sbin/lpr/lpd/recvjob.c
index d6b1cebd6dc..f24d92a60f7 100644
--- a/usr.sbin/lpr/lpd/recvjob.c
+++ b/usr.sbin/lpr/lpd/recvjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: recvjob.c,v 1.11 1997/07/25 20:12:13 mickey Exp $ */
+/* $OpenBSD: recvjob.c,v 1.12 1997/10/05 11:37:01 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95";
#else
-static char rcsid[] = "$OpenBSD: recvjob.c,v 1.11 1997/07/25 20:12:13 mickey Exp $";
+static char rcsid[] = "$OpenBSD: recvjob.c,v 1.12 1997/10/05 11:37:01 deraadt Exp $";
#endif
#endif /* not lint */
@@ -265,7 +265,8 @@ readfile(file, size)
if (err)
frecverr("%s: write error", file);
if (noresponse()) { /* file sent had bad data in it */
- (void) unlink(file);
+ if (strchr(file, '/') == NULL)
+ (void) unlink(file);
return(0);
}
ack();
@@ -330,15 +331,16 @@ static void
rcleanup(signo)
int signo;
{
- if (tfname[0])
+ if (tfname[0] && strchr(tfname, '/') == NULL)
(void) unlink(tfname);
- if (dfname[0])
+ if (dfname[0] && strchr(dfname, '/') == NULL) {
do {
do
(void) unlink(dfname);
while (dfname[2]-- != 'A');
dfname[2] = 'z';
} while (dfname[0]-- != 'd');
+ }
dfname[0] = '\0';
}