diff --git a/at-3.1.8-atrm-race.patch b/at-3.1.8-atrm-race.patch new file mode 100644 index 0000000..22dde57 --- /dev/null +++ b/at-3.1.8-atrm-race.patch @@ -0,0 +1,33 @@ +Copyright (c) 2011 Ingo Schwarze + +This patch is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +--- atd.c 2011-02-25 12:40:46.000000000 +0100 ++++ atd.c.new 2011-02-25 14:59:44.000000000 +0100 +@@ -291,16 +291,16 @@ run_file(const char *filename, uid_t uid + newname[0] = '='; + + /* We try to make a hard link to lock the file. If we fail, then +- * somebody else has already locked it (a second atd?); log the ++ * somebody else has already locked or deleted it; log the + * fact and return. + */ + if (link(filename, newname) == -1) { +- if (errno == EEXIST) { +- syslog(LOG_WARNING, "trying to execute job %.100s twice",filename); +- return; +- } else { +- perr("Can't link execution file"); +- } ++ syslog(LOG_WARNING, ++ (errno == EEXIST ? "trying to execute job %.100s twice" ++ : "Can't link execution file %.100s: %m"), ++ filename); ++ free(newname); ++ return; + } + /* If something goes wrong between here and the unlink() call, + * the job gets restarted as soon as the "=" entry is cleared diff --git a/at.changes b/at.changes index 79e22f1..6e22f22 100644 --- a/at.changes +++ b/at.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 5 15:36:24 UTC 2011 - vcizek@novell.com + +- fixed atd-atrm race condition (bnc#679857) + ------------------------------------------------------------------- Tue Mar 1 15:33:34 UTC 2011 - vcizek@novell.com diff --git a/at.spec b/at.spec index e616d52..8be2a1e 100644 --- a/at.spec +++ b/at.spec @@ -56,6 +56,8 @@ Patch15: %{name}-%{version}-leak-fix.patch Patch16: at-3.1.8-denylist.patch #PATCH_FIX-OPENSUSE plan jobs with past time to tomorrow (bnc#672586) Patch17: %{name}-%{version}-tomorrow.patch +#PATCH_FIX-OPENSUSE race condition of atrm against job execution (bnc#679857) +Patch18: %{name}-%{version}-atrm-race.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: %{_sbindir}/useradd %{_sbindir}/groupadd %fillup_prereq %insserv_prereq Recommends: smtp_daemon @@ -92,6 +94,7 @@ Authors: %patch15 %patch16 %patch17 -p1 +%patch18 %build %{?suse_update_config:%{suse_update_config -f}}