From d0c8fe336030ad80c9c8089a00378775fc981824 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 05:44:19 +0000 Subject: import at-3.1.13-22.el7 --- diff --git a/SOURCES/at-3.1.13-clear-nonjobs.patch b/SOURCES/at-3.1.13-clear-nonjobs.patch new file mode 100644 index 0000000..14fd9ba --- /dev/null +++ b/SOURCES/at-3.1.13-clear-nonjobs.patch @@ -0,0 +1,42 @@ +diff -up at-3.1.13/atd.c.clear-nonjobs at-3.1.13/atd.c +--- at-3.1.13/atd.c.clear-nonjobs 2016-04-20 17:15:00.579327865 +0200 ++++ at-3.1.13/atd.c 2016-04-20 17:18:06.215376744 +0200 +@@ -414,10 +414,22 @@ run_file(const char *filename, uid_t uid + sprintf(fmt, "#!/bin/sh\n# atrun uid=%%d gid=%%d\n# mail %%%ds %%d", + mailsize ); + ++ /* Unlink the file unless there was an error reading it (perhaps ++ * temporary). ++ * If the file has a bogus format there is no reason in trying ++ * to run it again and again. ++ */ + if (fscanf(stream, fmt, +- &nuid, &ngid, mailname, &send_mail) != 4) +- pabort("File %.500s is in wrong format - aborting", +- filename); ++ &nuid, &ngid, mailname, &send_mail) != 4) { ++ if (ferror(stream)) ++ perr("Error reading the job file"); ++ ++ unlink(filename); ++ pabort("File %.500s is in wrong format - aborting", ++ filename); ++ } ++ ++ unlink(filename); + + if (mailname[0] == '-') + pabort("illegal mail name %.300s in job %8lu (%.300s)", mailname, +@@ -427,12 +439,6 @@ run_file(const char *filename, uid_t uid + pabort("Job %8lu (%.500s) - userid %d does not match file uid %d", + jobno, filename, nuid, uid); + +- /* We are now committed to executing this script. Unlink the +- * original. +- */ +- +- unlink(filename); +- + fclose(stream); + if (chdir(ATSPOOL_DIR) < 0) + perr("Cannot chdir to " ATSPOOL_DIR); diff --git a/SOURCES/at-3.1.13-fclose-error.patch b/SOURCES/at-3.1.13-fclose-error.patch new file mode 100644 index 0000000..74d4958 --- /dev/null +++ b/SOURCES/at-3.1.13-fclose-error.patch @@ -0,0 +1,26 @@ +diff -up at-3.1.13/at.c.fclose at-3.1.13/at.c +--- at-3.1.13/at.c.fclose 2016-04-20 17:15:00.584327893 +0200 ++++ at-3.1.13/at.c 2016-04-20 17:15:50.453609665 +0200 +@@ -209,7 +209,11 @@ nextjob() + jobno = (1 + jobno) % 0xfffff; /* 2^20 jobs enough? */ + fprintf(fid, "%05lx\n", jobno); + +- fclose(fid); ++ if (ferror(fid)) ++ jobno = EOF; ++ ++ if (fclose(fid) != 0) ++ jobno = EOF; + return jobno; + } + +@@ -498,7 +502,8 @@ writefile(time_t runtimer, char queue) + if (ferror(stdin)) + panic("Input error"); + +- fclose(fp); ++ if (fclose(fp) != 0) ++ panic("Output error"); + + /* Set the x bit so that we're ready to start executing + */ diff --git a/SOURCES/at-3.1.13-utc-dst.patch b/SOURCES/at-3.1.13-utc-dst.patch new file mode 100644 index 0000000..1f72c39 --- /dev/null +++ b/SOURCES/at-3.1.13-utc-dst.patch @@ -0,0 +1,24 @@ +diff -up at-3.1.13/parsetime.y.dst at-3.1.13/parsetime.y +--- at-3.1.13/parsetime.y.dst 2011-06-25 14:43:14.000000000 +0200 ++++ at-3.1.13/parsetime.y 2016-04-20 17:23:24.140171655 +0200 +@@ -476,8 +476,8 @@ parsetime(time_t currtime, int argc, cha + exectm = *localtime(&currtime); + currtime -= exectm.tm_sec; + exectm.tm_sec = 0; +- exectm.tm_isdst = -1; + memcpy(&currtm,&exectm,sizeof(currtm)); ++ exectm.tm_isdst = -1; + time_only = 0; + yearspec = 0; + +@@ -503,8 +503,8 @@ parsetime(time_t currtime, int argc, cha + return 0; + if (isgmt) { + exectime -= timezone; +- if (currtm.tm_isdst && !exectm.tm_isdst) +- exectime -= 3600; ++ if (exectm.tm_isdst) ++ exectime += 3600; + } + if (exectime < currtime) + panic("refusing to create job destined in the past"); diff --git a/SOURCES/atd.systemd b/SOURCES/atd.systemd index 7bdf82c..abe24c1 100644 --- a/SOURCES/atd.systemd +++ b/SOURCES/atd.systemd @@ -5,6 +5,7 @@ After=syslog.target systemd-user-sessions.service [Service] EnvironmentFile=/etc/sysconfig/atd ExecStart=/usr/sbin/atd -f $OPTS +IgnoreSIGPIPE=no [Install] WantedBy=multi-user.target diff --git a/SPECS/at.spec b/SPECS/at.spec index f6ea576..a48aed9 100644 --- a/SPECS/at.spec +++ b/SPECS/at.spec @@ -4,7 +4,7 @@ Summary: Job spooling tools Name: at Version: 3.1.13 -Release: 20%{?dist} +Release: 22%{?dist} # http://packages.debian.org/changelogs/pool/main/a/at/current/copyright # + install-sh is MIT license with changes under Public Domain License: GPLv3+ and GPLv2+ and ISC and MIT and Public Domain @@ -30,6 +30,9 @@ Patch9: at-3.1.13-mailwithhostname.patch Patch10: at-3.1.13-usePOSIXtimers.patch Patch11: at-3.1.13-help.patch Patch12: at-3.1.10-filter-environment.patch +Patch13: at-3.1.13-fclose-error.patch +Patch14: at-3.1.13-clear-nonjobs.patch +Patch15: at-3.1.13-utc-dst.patch BuildRequires: fileutils /etc/init.d BuildRequires: flex flex-static bison autoconf @@ -84,6 +87,9 @@ cp %{SOURCE1} . %patch10 -p1 -b .posix %patch11 -p1 -b .help %patch12 -p1 -b .filter-environment +%patch13 -p1 -b .fclose +%patch14 -p1 -b .clear-nonjobs +%patch15 -p1 -b .dst %build # patch9 touches configure.in @@ -190,6 +196,14 @@ chown daemon:daemon %{_localstatedir}/spool/at/.SEQ %attr(0755,root,root) %{_initrddir}/atd %changelog +* Mon May 23 2016 Tomáš Mráz - 3.1.13-22 +- SIGPIPE should not be ignored in atd (#1338039) + +* Wed Apr 20 2016 Tomáš Mráz - 3.1.13-21 +- correct the DST correction when using UTC time specification (#1328832) +- clear non-job files from at dir and test for write error on fclose + to fix bogus syslog messages + * Mon Jun 22 2015 Tomáš Mráz - 3.1.13-20 - build the package with hardening flags (PIE, full RELRO)