diff options
Diffstat (limited to 'usr.sbin/cron/crontab/crontab.c')
-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)); |