Compare commits

..

No commits in common. "c8" and "c9" have entirely different histories.
c8 ... c9

8 changed files with 241 additions and 68 deletions

View File

@ -1 +1 @@
a1734aa9da9188aecd8f96d59551f191ddac545a SOURCES/at_3.1.20.orig.tar.gz 30a8158968ff0ffe55d7f728c568618f965c98d8 SOURCES/at_3.1.23.orig.tar.gz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/at_3.1.20.orig.tar.gz SOURCES/at_3.1.23.orig.tar.gz

View File

@ -1,22 +0,0 @@
diff -up at-3.1.20/atd.8.in.document-n at-3.1.20/atd.8.in
--- at-3.1.20/atd.8.in.document-n 2015-08-22 00:09:22.000000000 +0200
+++ at-3.1.20/atd.8.in 2017-09-14 14:17:04.922086349 +0200
@@ -9,6 +9,7 @@ atd \- run jobs queued for later executi
.IR batch_interval ]
.RB [ -d ]
.RB [ -f ]
+.RB [ -n ]
.RB [ -s ]
.SH DESCRIPTION
.B atd
@@ -40,6 +41,10 @@ Run
.BR atd
in the foreground.
.TP 8
+.B -n
+Append the hostname of the system to the subject of the e-mails sent by
+.BR atd .
+.TP 8
.B -s
Process the at/batch queue only once.
This is primarily of use for compatibility with old versions of

View File

@ -0,0 +1,22 @@
diff -up at-3.1.23/atd.8.in.document-n at-3.1.23/atd.8.in
--- at-3.1.23/atd.8.in.document-n 2018-08-27 14:49:09.824182482 +0200
+++ at-3.1.23/atd.8.in 2018-08-27 14:50:34.625518639 +0200
@@ -9,6 +9,7 @@ atd \- run jobs queued for later executi
.IR batch_interval ]
.RB [ \-d ]
.RB [ \-f ]
+.RB [ \-n ]
.RB [ \-s ]
.SH DESCRIPTION
.B atd
@@ -44,6 +45,10 @@ in the foreground.
Process the at/batch queue only once.
This is primarily of use for compatibility with old versions of
.BR at ;
+.B \-n
+Append the hostname of the system to the subject of the e-mails sent by
+.BR atd .
+.TP 8
.B "atd \-s"
is equivalent to the old
.B atrun

View File

@ -0,0 +1,33 @@
From 3a5bfc32357bd6bf27bde41a599ce797be221420 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Poho=C5=99elsk=C3=BD?= <opohorel@redhat.com>
Date: Mon, 30 Jun 2025 15:23:26 +0200
Subject: [PATCH] Reject past dates when using -t option
-t option was missing validation to reject past dates, unlike the
regular time parsing.
Add the same past date validation used by parsetime() to the posixtime()
code path to ensure consistent behavior when parsing time.
---
at.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/at.c b/at.c
index 2136e0b..d65168d 100644
--- a/at.c
+++ b/at.c
@@ -860,6 +860,11 @@ main(int argc, char **argv)
fprintf(stderr, "invalid date format: %s\n", optarg);
exit(EXIT_FAILURE);
}
+ /* Check if the parsed time is in the past */
+ if (timer < time(NULL)) {
+ fprintf(stderr, "at: refusing to create job destined in the past\n");
+ exit(EXIT_FAILURE);
+ }
/* drop seconds */
timer -= timer % 60;
break;
--
2.50.0

View File

@ -0,0 +1,115 @@
From 4be4813262b3b57a95a5f3ce909d30741aa3ac72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= <jstanek@redhat.com>
Date: Fri, 9 Apr 2021 16:47:33 +0200
Subject: [PATCH] Address issues raised by static analysis
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Jan Staněk <jstanek@redhat.com>
---
at.c | 22 ++++++++++++++++++----
daemon.c | 21 ++++++++++++++-------
2 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/at.c b/at.c
index df55dc9..0c74e2e 100644
--- a/at.c
+++ b/at.c
@@ -545,17 +545,27 @@ writefile(time_t runtimer, char queue)
return;
}
- if (fstat(fd, &statbuf) == -1)
+ if (fstat(fd, &statbuf) == -1) {
+ close(fd);
return;
+ }
if ((statbuf.st_uid != 0) || !S_ISREG(statbuf.st_mode) ||
- (statbuf.st_mode & (S_IWGRP | S_IWOTH)))
+ (statbuf.st_mode & (S_IWGRP | S_IWOTH))) {
+ close(fd);
return;
+ }
fp = fdopen(fd, "r");
- if (fp == NULL)
+ if (fp == NULL) {
+ close(fd);
return;
- if (fscanf(fp, "%d", &pid) != 1)
+ }
+ if (fscanf(fp, "%d", &pid) != 1) {
+ fclose(fp);
return;
+ } else {
+ fclose(fp);
+ }
kill_errno = 0;
@@ -640,6 +650,8 @@ list_jobs(void)
else
printf("%ld\t%s %c\n", jobno, timestr, queue);
}
+ closedir(spool);
+
PRIV_END
}
@@ -722,6 +734,8 @@ process_jobs(int argc, char **argv, int what)
putchar(ch);
}
done = 1;
+ fclose(fp);
+ fp = NULL;
}
else {
perr("Cannot open %.500s", dirent->d_name);
diff --git a/daemon.c b/daemon.c
index 4003b56..bc8191e 100644
--- a/daemon.c
+++ b/daemon.c
@@ -122,18 +122,23 @@ daemon_setup()
/* Set up standard daemon environment */
pid_t pid;
mode_t old_umask;
- int fd;
+ int fd, devnull;
FILE *fp;
if (!daemon_debug) {
- close(0);
- close(1);
- close(2);
- if ((open("/dev/null", O_RDWR) != 0) ||
- (open("/dev/null", O_RDWR) != 1) ||
- (open("/dev/null", O_RDWR) != 2)) {
+ devnull = open("/dev/null", O_RDWR);
+ if (devnull == -1) {
perr("Error redirecting I/O");
}
+
+ if ((dup2(devnull, 0) == -1) ||
+ (dup2(devnull, 1) == -1) ||
+ (dup2(devnull, 2) == -1)) {
+ close(devnull);
+ perr("Error redirecting I/O");
+ } else {
+ close(devnull);
+ }
}
if (daemon_foreground)
@@ -208,6 +213,8 @@ daemon_setup()
fcntl(fd, F_SETFD, FD_CLOEXEC);
PRIV_END
+ /* See the above comment. */
+ /* coverity[leaked_storage: FALSE] */
return;
}
--
2.31.1

View File

@ -1,11 +1,13 @@
[Unit] [Unit]
Description=Job spooling tools Description=Deferred execution scheduler
Documentation=man:atd(8)
After=syslog.target systemd-user-sessions.service After=syslog.target systemd-user-sessions.service
[Service] [Service]
EnvironmentFile=/etc/sysconfig/atd EnvironmentFile=/etc/sysconfig/atd
ExecStart=/usr/sbin/atd -f $OPTS ExecStart=/usr/sbin/atd -f $OPTS
IgnoreSIGPIPE=no IgnoreSIGPIPE=no
KillMode=process
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -2,12 +2,11 @@
Summary: Job spooling tools Summary: Job spooling tools
Name: at Name: at
Version: 3.1.20 Version: 3.1.23
Release: 12%{?dist} Release: 12%{?dist}
# http://packages.debian.org/changelogs/pool/main/a/at/current/copyright # http://packages.debian.org/changelogs/pool/main/a/at/current/copyright
# + install-sh is MIT license with changes under Public Domain # + install-sh is MIT license with changes under Public Domain
License: GPLv3+ and GPLv2+ and ISC and MIT and Public Domain License: GPLv3+ and GPLv2+ and ISC and MIT and Public Domain
Group: System Environment/Daemons
URL: http://ftp.debian.org/debian/pool/main/a/at URL: http://ftp.debian.org/debian/pool/main/a/at
Source: http://ftp.debian.org/debian/pool/main/a/at/at_%{version}.orig.tar.gz Source: http://ftp.debian.org/debian/pool/main/a/at/at_%{version}.orig.tar.gz
@ -16,23 +15,25 @@ Source1: pam_atd
Source3: atd.sysconf Source3: atd.sysconf
Source5: atd.systemd Source5: atd.systemd
Patch0: at-aarch64.patch Patch: at-aarch64.patch
Patch1: at-3.1.18-make.patch Patch: at-3.1.18-make.patch
Patch2: at-3.1.20-pam.patch Patch: at-3.1.20-pam.patch
Patch4: at-3.1.14-opt_V.patch Patch: at-3.1.14-opt_V.patch
Patch5: at-3.1.20-shell.patch Patch: at-3.1.20-shell.patch
Patch6: at-3.1.18-nitpicks.patch Patch: at-3.1.18-nitpicks.patch
Patch8: at-3.1.14-fix_no_export.patch Patch: at-3.1.14-fix_no_export.patch
Patch9: at-3.1.14-mailwithhostname.patch Patch: at-3.1.14-mailwithhostname.patch
Patch10: at-3.1.14-usePOSIXtimers.patch Patch: at-3.1.14-usePOSIXtimers.patch
Patch12: at-3.1.20-aborted-jobs.patch Patch: at-3.1.20-aborted-jobs.patch
Patch13: at-3.1.18-noabort.patch Patch: at-3.1.18-noabort.patch
Patch14: at-3.1.16-fclose-error.patch Patch: at-3.1.16-fclose-error.patch
Patch15: at-3.1.16-clear-nonjobs.patch Patch: at-3.1.16-clear-nonjobs.patch
Patch16: at-3.1.18-utc-dst.patch Patch: at-3.1.18-utc-dst.patch
Patch17: at-3.1.20-lock-locks.patch Patch: at-3.1.20-lock-locks.patch
Patch18: at-3.1.20-document-n.patch Patch: at-3.1.23-document-n.patch
Patch19: at-3.1.20-log-jobs.patch Patch: at-3.1.20-log-jobs.patch
Patch: at-3.2.23-coverity-fix.patch
Patch: at-3.1.23-past-date.patch
BuildRequires: gcc BuildRequires: gcc
BuildRequires: flex flex-static bison autoconf BuildRequires: flex flex-static bison autoconf
@ -46,6 +47,7 @@ BuildRequires: pam-devel
Conflicts: crontabs <= 1.5 Conflicts: crontabs <= 1.5
# No, I'm not kidding # No, I'm not kidding
BuildRequires: smtpdaemon BuildRequires: smtpdaemon
BuildRequires: make
Requires(post): systemd-units Requires(post): systemd-units
Requires(preun): systemd-units Requires(preun): systemd-units
@ -66,28 +68,12 @@ need to be repeated at the same time every day/week, etc. you should
use crontab instead. use crontab instead.
%prep %prep
%setup -q %autosetup -N
cp %{SOURCE1} . cp %{SOURCE1} .
%patch0 -p1 -b .arm %autopatch -p1
%patch1 -p1 -b .make
%patch2 -p1 -b .pam
%patch4 -p1 -b .opt_V
%patch5 -p1 -b .shell
%patch6 -p1 -b .nit
%patch8 -p1 -b .export
%patch9 -p1 -b .mail
%patch10 -p1 -b .posix
%patch12 -p1 -b .aborted
%patch13 -p1 -b .noabort
%patch14 -p1 -b .fclose
%patch15 -p1 -b .clear-nojobs
%patch16 -p1 -b .dst
%patch17 -p1 -b .lock-locks
%patch18 -p1 -b .document-n
%patch19 -p1 -b .log-jobs
%build %build
# patch9 touches configure.in # at-3.1.14-usePOSIXtimers.patch touches configure.in
autoconf autoconf
# uselles files # uselles files
rm -f lex.yy.* y.tab.* rm -f lex.yy.* y.tab.*
@ -96,9 +82,7 @@ rm -f lex.yy.* y.tab.*
--with-daemon_username=root \ --with-daemon_username=root \
--with-daemon_groupname=root \ --with-daemon_groupname=root \
--with-selinux \ --with-selinux \
%if %{with pam} %{?with_pam:--with-pam}
--with-pam
%endif
make make
@ -183,9 +167,48 @@ chown root:root %{_localstatedir}/spool/at/.SEQ
%attr(0644,root,root) /%{_unitdir}/atd.service %attr(0644,root,root) /%{_unitdir}/atd.service
%changelog %changelog
* Mon Apr 04 2022 Jan Staněk <jstanek@redhat.com> - 3.1.20-12 * Mon Jun 30 2025 Ondřej Pohořelský <opohorel@redhat.com> - 3.1.23-12
- Add patch to fix past date handling
- Resolves: RHEL-97024
* Fri Apr 01 2022 Jan Staněk <jstanek@redhat.com> - 3.1.23-10
- Add preceding newline to delimiter in at-3.1.20-shell.patch - Add preceding newline to delimiter in at-3.1.20-shell.patch
Resolves: rhbz#2070450 Resolves: rhbz#2070858
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com>
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Jun 22 2021 Mohan Boddu <mboddu@redhat.com>
- Rebuilt for RHEL 9 BETA for openssl 3.0
Related: rhbz#1971065
* Fri Apr 23 2021 Jan Staněk <jstanek@redhat.com> - 3.1.23-8
- Patch issues found by coverity. Resolves: rhbz#1938678
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 3.1.23-7
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.23-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.23-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.23-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.23-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.23-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Aug 27 2018 Tomáš Mráz <tmraz@redhat.com> - 3.1.23-1
- new upstream release
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.20-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed May 23 2018 Tomáš Mráz <tmraz@redhat.com> - 3.1.20-11 * Wed May 23 2018 Tomáš Mráz <tmraz@redhat.com> - 3.1.20-11
- log the jobs being run - log the jobs being run