From e1b228cde8a23823b0da9a1e3df6d82d74218417 Mon Sep 17 00:00:00 2001 From: millert Date: Thu, 8 Jun 2017 16:23:39 +0000 Subject: [PATCH] Add logging for when we find a non-file in the at spool that was a file when we scanned the at spool earlier. --- usr.sbin/cron/atrun.c | 14 ++++++++++---- 1 file 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 @@ -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 */ } /* -- 2.20.1