- fixed atd-atrm race condition (bnc#679857)

OBS-URL: https://build.opensuse.org/package/show/Base:System/at?expand=0&rev=28
This commit is contained in:
Vítězslav Čížek 2011-04-07 14:40:54 +00:00 committed by Git OBS Bridge
parent 47545ca973
commit d8d6daa631
3 changed files with 41 additions and 0 deletions

33
at-3.1.8-atrm-race.patch Normal file
View File

@ -0,0 +1,33 @@
Copyright (c) 2011 Ingo Schwarze <ischwarze@astaro.com>
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

View File

@ -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

View File

@ -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}}