Date: Tue, 11 Jun 2013 18:50:01 GMT From: dfilter@FreeBSD.ORG (dfilter service) To: freebsd-bugs@FreeBSD.org Subject: Re: bin/113239: commit references a PR Message-ID: <201306111850.r5BIo0gE084517@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/113239; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/113239: commit references a PR Date: Tue, 11 Jun 2013 18:43:54 +0000 (UTC) Author: ghelmer Date: Tue Jun 11 18:43:27 2013 New Revision: 251625 URL: http://svnweb.freebsd.org/changeset/base/251625 Log: Prevent races running the queue by serializing access to the queue directory. PR: bin/113239 Modified: head/libexec/atrun/atrun.c Modified: head/libexec/atrun/atrun.c ============================================================================== --- head/libexec/atrun/atrun.c Tue Jun 11 18:43:25 2013 (r251624) +++ head/libexec/atrun/atrun.c Tue Jun 11 18:43:27 2013 (r251625) @@ -31,6 +31,7 @@ static const char rcsid[] = /* System Headers */ #include <sys/fcntl.h> +#include <sys/file.h> #include <sys/types.h> #include <sys/stat.h> #ifdef __FreeBSD__ @@ -521,6 +522,9 @@ main(int argc, char *argv[]) if ((spool = opendir(".")) == NULL) perr("cannot read %s", ATJOB_DIR); + if (flock(dirfd(spool), LOCK_EX) == -1) + perr("cannot lock %s", ATJOB_DIR); + now = time(NULL); run_batch = 0; batch_uid = (uid_t) -1; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306111850.r5BIo0gE084517>