summaryrefslogtreecommitdiff
path: root/usr.bin/at/panic.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1996-08-03 20:16:58 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1996-08-03 20:16:58 +0000
commit14c0ee1fd880d587f6c818255166cf6f4eec5ae7 (patch)
treedb158ef5eba7aeefd3d67de21354e4d76f2e1406 /usr.bin/at/panic.c
parent9ed50adf6f37005c454a0723bee27c3a243f48d2 (diff)
Was runing most of the code with real and effective uid of 0, contrary
to the comments. Fixed that and made sure unlink of job file is done as root so it can succeed. Also will now detect empty input.
Diffstat (limited to 'usr.bin/at/panic.c')
-rw-r--r--usr.bin/at/panic.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr.bin/at/panic.c b/usr.bin/at/panic.c
index b616899085e..d6b03db8edd 100644
--- a/usr.bin/at/panic.c
+++ b/usr.bin/at/panic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: panic.c,v 1.2 1996/06/26 05:31:28 deraadt Exp $ */
+/* $OpenBSD: panic.c,v 1.3 1996/08/03 20:16:57 millert Exp $ */
/* $NetBSD: panic.c,v 1.2 1995/03/25 18:13:33 glass Exp $ */
/*
@@ -38,11 +38,12 @@
#include "panic.h"
#include "at.h"
+#include "privs.h"
/* File scope variables */
#ifndef lint
-static char rcsid[] = "$OpenBSD: panic.c,v 1.2 1996/06/26 05:31:28 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: panic.c,v 1.3 1996/08/03 20:16:57 millert Exp $";
#endif
/* External variables */
@@ -56,8 +57,11 @@ panic(a)
/* Something fatal has happened, print error message and exit.
*/
fprintf(stderr, "%s: %s\n", namep, a);
- if (fcreated)
+ if (fcreated) {
+ PRIV_START
unlink(atfile);
+ PRIV_END
+ }
exit(EXIT_FAILURE);
}
@@ -69,8 +73,11 @@ perr(a)
/* Some operating system error; print error message and exit.
*/
perror(a);
- if (fcreated)
+ if (fcreated) {
+ PRIV_START
unlink(atfile);
+ PRIV_END
+ }
exit(EXIT_FAILURE);
}