mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Add a one second sleep before touching the spool directory. If the touch
occurs in the same second as the earlier operations to create the temporary file and the cron(8) daemon is rescans the spool directory during that second, then the daemon may miss a cron edit and not properly update its internal database. MFC after: 1 month
This commit is contained in:
parent
7b736a7a50
commit
5cdfc55cab
1 changed files with 9 additions and 0 deletions
|
|
@ -608,6 +608,15 @@ replace_cmd() {
|
|||
|
||||
log_it(RealUser, Pid, "REPLACE", User);
|
||||
|
||||
/*
|
||||
* Creating the 'tn' temp file has already updated the
|
||||
* modification time of the spool directory. Sleep for a
|
||||
* second to ensure that poke_daemon() sets a later
|
||||
* modification time. Otherwise, this can race with the cron
|
||||
* daemon scanning for updated crontabs.
|
||||
*/
|
||||
sleep(1);
|
||||
|
||||
poke_daemon();
|
||||
|
||||
return (0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue