diff options
author | paul <paul@FreeBSD.org> | 2000-10-15 00:35:34 +0000 |
---|---|---|
committer | paul <paul@FreeBSD.org> | 2000-10-15 00:35:34 +0000 |
commit | 71e06852db4ba7be35c1ef5e0020ff889d00f0a9 (patch) | |
tree | 6569b592ac271b1bd08784ea7902f7a08d12c0a0 /usr.sbin/cron | |
parent | 0da67d8763b40cee624dca4977345ff34a4ea5aa (diff) | |
download | FreeBSD-src-71e06852db4ba7be35c1ef5e0020ff889d00f0a9.zip FreeBSD-src-71e06852db4ba7be35c1ef5e0020ff889d00f0a9.tar.gz |
Since -e and -r are right next to each other prompt before clobbering
a crontab you were planning to edit.
Diffstat (limited to 'usr.sbin/cron')
-rw-r--r-- | usr.sbin/cron/crontab/crontab.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/usr.sbin/cron/crontab/crontab.c b/usr.sbin/cron/crontab/crontab.c index 1ae6777..5490f4c 100644 --- a/usr.sbin/cron/crontab/crontab.c +++ b/usr.sbin/cron/crontab/crontab.c @@ -248,6 +248,16 @@ list_cmd() { static void delete_cmd() { char n[MAX_FNAME]; + int ch, first; + + if (isatty(STDIN_FILENO)) { + (void)fprintf(stderr, "remove crontab for %s? ", User); + first = ch = getchar(); + while (ch != '\n' && ch != EOF) + ch = getchar(); + if (first != 'y' && first != 'Y') + return; + } log_it(RealUser, Pid, "DELETE", User); (void) sprintf(n, CRON_TAB(User)); |