Compare commits

...

No commits in common. "imports/c9/at-3.1.23-10.el9" and "c8" have entirely different histories.

8 changed files with 71 additions and 202 deletions

View File

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

2
.gitignore vendored
View File

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

View File

@ -0,0 +1,22 @@
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

@ -41,7 +41,7 @@ diff -up at-3.1.20/at.c.shell at-3.1.20/at.c
fprintf(stderr, "<EOT>\n");
}
- fprintf(fp, "\n");
+ fprintf(fp, "marcinDELIMITER%08lx\n", i);
+ fprintf(fp, "\nmarcinDELIMITER%08lx\n", i);
if (ferror(fp))
panic("Output error");
fflush(fp);

View File

@ -1,22 +0,0 @@
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

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

View File

@ -2,11 +2,12 @@
Summary: Job spooling tools
Name: at
Version: 3.1.23
Release: 10%{?dist}
Version: 3.1.20
Release: 12%{?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
Group: System Environment/Daemons
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
@ -15,24 +16,23 @@ Source1: pam_atd
Source3: atd.sysconf
Source5: atd.systemd
Patch: at-aarch64.patch
Patch: at-3.1.18-make.patch
Patch: at-3.1.20-pam.patch
Patch: at-3.1.14-opt_V.patch
Patch: at-3.1.20-shell.patch
Patch: at-3.1.18-nitpicks.patch
Patch: at-3.1.14-fix_no_export.patch
Patch: at-3.1.14-mailwithhostname.patch
Patch: at-3.1.14-usePOSIXtimers.patch
Patch: at-3.1.20-aborted-jobs.patch
Patch: at-3.1.18-noabort.patch
Patch: at-3.1.16-fclose-error.patch
Patch: at-3.1.16-clear-nonjobs.patch
Patch: at-3.1.18-utc-dst.patch
Patch: at-3.1.20-lock-locks.patch
Patch: at-3.1.23-document-n.patch
Patch: at-3.1.20-log-jobs.patch
Patch: at-3.2.23-coverity-fix.patch
Patch0: at-aarch64.patch
Patch1: at-3.1.18-make.patch
Patch2: at-3.1.20-pam.patch
Patch4: at-3.1.14-opt_V.patch
Patch5: at-3.1.20-shell.patch
Patch6: at-3.1.18-nitpicks.patch
Patch8: at-3.1.14-fix_no_export.patch
Patch9: at-3.1.14-mailwithhostname.patch
Patch10: at-3.1.14-usePOSIXtimers.patch
Patch12: at-3.1.20-aborted-jobs.patch
Patch13: at-3.1.18-noabort.patch
Patch14: at-3.1.16-fclose-error.patch
Patch15: at-3.1.16-clear-nonjobs.patch
Patch16: at-3.1.18-utc-dst.patch
Patch17: at-3.1.20-lock-locks.patch
Patch18: at-3.1.20-document-n.patch
Patch19: at-3.1.20-log-jobs.patch
BuildRequires: gcc
BuildRequires: flex flex-static bison autoconf
@ -46,7 +46,6 @@ BuildRequires: pam-devel
Conflicts: crontabs <= 1.5
# No, I'm not kidding
BuildRequires: smtpdaemon
BuildRequires: make
Requires(post): systemd-units
Requires(preun): systemd-units
@ -67,12 +66,28 @@ need to be repeated at the same time every day/week, etc. you should
use crontab instead.
%prep
%autosetup -N
%setup -q
cp %{SOURCE1} .
%autopatch -p1
%patch0 -p1 -b .arm
%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
# at-3.1.14-usePOSIXtimers.patch touches configure.in
# patch9 touches configure.in
autoconf
# uselles files
rm -f lex.yy.* y.tab.*
@ -81,7 +96,9 @@ rm -f lex.yy.* y.tab.*
--with-daemon_username=root \
--with-daemon_groupname=root \
--with-selinux \
%{?with_pam:--with-pam}
%if %{with pam}
--with-pam
%endif
make
@ -166,40 +183,9 @@ chown root:root %{_localstatedir}/spool/at/.SEQ
%attr(0644,root,root) /%{_unitdir}/atd.service
%changelog
* 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
* Mon Apr 04 2022 Jan Staněk <jstanek@redhat.com> - 3.1.20-12
- Add preceding newline to delimiter in at-3.1.20-shell.patch
Resolves: rhbz#2070450
* Wed May 23 2018 Tomáš Mráz <tmraz@redhat.com> - 3.1.20-11
- log the jobs being run