summaryrefslogtreecommitdiff
path: root/usr.bin/at/at.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/at.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/at.c')
-rw-r--r--usr.bin/at/at.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c
index d1de84d0c35..39ee135c94a 100644
--- a/usr.bin/at/at.c
+++ b/usr.bin/at/at.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: at.c,v 1.2 1996/06/26 05:31:27 deraadt Exp $ */
+/* $OpenBSD: at.c,v 1.3 1996/08/03 20:16:52 millert Exp $ */
/* $NetBSD: at.c,v 1.4 1995/03/25 18:13:31 glass Exp $ */
/*
@@ -65,7 +65,7 @@
/* File scope variables */
#ifndef lint
-static char rcsid[] = "$OpenBSD: at.c,v 1.2 1996/06/26 05:31:27 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: at.c,v 1.3 1996/08/03 20:16:52 millert Exp $";
#endif
char *no_export[] =
@@ -248,13 +248,6 @@ writefile(runtimer, queue)
PRIV_END
/*
- * We no longer need suid root; now we just need to be able to
- * write to the directory, if necessary.
- */
-
- REDUCE_PRIV(effective_uid);
-
- /*
* We've successfully created the file; let's set the flag so it
* gets removed in case of an interrupt or error.
*/
@@ -345,8 +338,12 @@ writefile(runtimer, queue)
*/
fprintf(fp, "cd %s\n", cwdname());
- while ((ch = getchar()) != EOF)
+ if ((ch = getchar()) == EOF)
+ panic("Input error");
+
+ do {
fputc(ch, fp);
+ } while ((ch = getchar()) != EOF);
fprintf(fp, "\n");
if (ferror(fp))