diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-07-18 20:57:28 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-07-18 20:57:28 +0000 |
commit | abe3a6221fda054003729a6f7d6d61dbb31e77b0 (patch) | |
tree | 0a2b0f63fc52bc1a1cbf0a782f63a4f41f37bf23 /usr.sbin | |
parent | d82d812aa467e2a9f3ffaf2c54f32162fdf0805f (diff) |
Be extra careful when unlinking data file to only remove a file is
it is in the current dir and df*. From imp@openbsd.org.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/lpr/common_source/rmjob.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/lpr/common_source/rmjob.c b/usr.sbin/lpr/common_source/rmjob.c index ebe49673ad4..286e836fcf0 100644 --- a/usr.sbin/lpr/common_source/rmjob.c +++ b/usr.sbin/lpr/common_source/rmjob.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rmjob.c,v 1.6 1997/07/17 09:14:11 deraadt Exp $ */ +/* $OpenBSD: rmjob.c,v 1.7 1997/07/18 20:57:27 millert Exp $ */ /* * Copyright (c) 1983, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)rmjob.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: rmjob.c,v 1.6 1997/07/17 09:14:11 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: rmjob.c,v 1.7 1997/07/18 20:57:27 millert Exp $"; #endif #endif /* not lint */ @@ -216,6 +216,8 @@ process(file) while (getline(cfp)) { switch (line[0]) { case 'U': /* unlink associated files */ + if (strchr(line+1, '/') || strncmp(line+1, "df", 2)) + break; do_unlink(line+1); } } |