diff options
author | millert <millert@openbsd.org> | 2017-06-08 16:23:39 +0000 |
---|---|---|
committer | millert <millert@openbsd.org> | 2017-06-08 16:23:39 +0000 |
commit | e1b228cde8a23823b0da9a1e3df6d82d74218417 (patch) | |
tree | ba832308d4a4005bee79e5e6ff9d88bbfa17aec0 /usr.sbin/cron | |
parent | clarify set prio: the second prio given applies to (diff) | |
download | wireguard-openbsd-e1b228cde8a23823b0da9a1e3df6d82d74218417.tar.xz wireguard-openbsd-e1b228cde8a23823b0da9a1e3df6d82d74218417.zip |
Add logging for when we find a non-file in the at spool that was
a file when we scanned the at spool earlier.
Diffstat (limited to 'usr.sbin/cron')
-rw-r--r-- | usr.sbin/cron/atrun.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/cron/atrun.c b/usr.sbin/cron/atrun.c index 4f230c30b19..6f08809a341 100644 --- a/usr.sbin/cron/atrun.c +++ b/usr.sbin/cron/atrun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atrun.c,v 1.45 2017/06/07 23:36:43 millert Exp $ */ +/* $OpenBSD: atrun.c,v 1.46 2017/06/08 16:23:39 millert Exp $ */ /* * Copyright (c) 2002-2003 Todd C. Miller <Todd.Miller@courtesan.com> @@ -193,11 +193,17 @@ atrun(at_db *db, double batch_maxload, time_t now) continue; } - if (fstatat(dfd, atfile, &sb, AT_SYMLINK_NOFOLLOW) != 0 || - !S_ISREG(sb.st_mode)) { + if (fstatat(dfd, atfile, &sb, AT_SYMLINK_NOFOLLOW) != 0) { TAILQ_REMOVE(&db->jobs, job, entries); free(job); - continue; /* disapeared or not a file */ + continue; /* disapeared from queue */ + } + if (!S_ISREG(sb.st_mode)) { + syslog(LOG_WARNING, "(CRON) NOT REGULAR (%s)", + atfile); + TAILQ_REMOVE(&db->jobs, job, entries); + free(job); + continue; /* was a file, no longer is */ } /* |