Date: Thu, 22 Jun 2017 07:10:01 +0000 (UTC) From: Ngie Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320223 - stable/10/usr.sbin/cron/cron Message-ID: <201706220710.v5M7A1xN080921@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Thu Jun 22 07:10:01 2017 New Revision: 320223 URL: https://svnweb.freebsd.org/changeset/base/320223 Log: MFC r308158: r308158 (by bapt): Allow symlinks to be followed in cron.d directories and fix detection of regular files on NFS Modified: stable/10/usr.sbin/cron/cron/database.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/cron/cron/database.c ============================================================================== --- stable/10/usr.sbin/cron/cron/database.c Thu Jun 22 07:08:18 2017 (r320222) +++ stable/10/usr.sbin/cron/cron/database.c Thu Jun 22 07:10:01 2017 (r320223) @@ -44,7 +44,7 @@ load_database(old_db) { DIR *dir; struct stat statbuf; - struct stat syscron_stat; + struct stat syscron_stat, st; time_t maxmtime; DIR_T *dp; cron_db new_db; @@ -124,7 +124,8 @@ load_database(old_db) while (NULL != (dp = readdir(dir))) { if (dp->d_name[0] == '.') continue; - if (dp->d_type != DT_REG) + if (fstatat(dirfd(dir), dp->d_name, &st, 0) == 0 && + !S_ISREG(st.st_mode)) continue; snprintf(tabname, sizeof(tabname), "%s/%s", syscrontabs[i].name, dp->d_name);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706220710.v5M7A1xN080921>