Compare commits

...
Sign in to create a new pull request.

20 commits

Author SHA1 Message Date
Fedora Release Engineering
c6de37879a Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild 2026-01-16 04:04:41 +00:00
Ondřej Pohořelský
99f9f320e1 Remove unnecessary Require 2025-09-29 10:27:02 +02:00
Ondřej Pohořelský
ced9e7e375 Remove broken and unused git submodule from tests 2025-09-24 18:32:27 +02:00
Ondřej Pohořelský
96f550ec59 Add /var/spool/at and /var/spool/at/spool directories into %%files section 2025-09-18 12:49:15 +02:00
Ondřej Pohořelský
774dcfc0e1 Use systemd-tmpfiles for /var/spool/at directories
Replace RPM scriptlets with systemd-tmpfiles to create /var/spool/at
structure, fixing Image Mode compatibility and bootc container lint
warnings.
2025-08-27 15:55:17 +02:00
Fedora Release Engineering
1fc88529b9 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-23 17:22:50 +00:00
Lukáš Zaoral
e11f7fc108 tests: migrate from STI to TMT 2025-07-04 13:25:15 +02:00
Ondřej Pohořelský
c697b4595c Fix past date handling with -t option 2025-06-26 09:42:57 +02:00
Ondřej Pohořelský
0da060e2af Claim ownership of /usr/share/at
Resolves: rhbz#2283298
2025-05-05 10:14:16 +02:00
Ondřej Pohořelský
0da79b8efb Unify bin and sbin directories
Resolves: rhbz#2339910
2025-01-27 13:49:35 +01:00
Fedora Release Engineering
5eee4f9624 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-16 11:51:06 +00:00
Ales Nezbeda
5f6bc87dd0 Backport PR from upstream addressing SAST issues 2024-08-09 11:11:16 +02:00
Fedora Release Engineering
14379bfef8 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-17 17:42:30 +00:00
Ondřej Pohořelský
7a6968e726 Corrected document-n patch
Resolves: rhbz#2276918
2024-05-02 16:19:57 +02:00
Fedora Release Engineering
ba26b4715f Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-22 23:43:30 +00:00
Fedora Release Engineering
10907ac039 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-19 13:47:50 +00:00
Fedora Release Engineering
0489cbcbe2 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-19 14:01:03 +00:00
Ondřej Pohořelský
36dcc21dda Convert licenses to SPDX format
Dropped MIT and Public Domain license as they are not present in upstream sources
2023-06-26 15:18:20 +02:00
Fedora Release Engineering
a069b01c5a Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-18 22:21:37 +00:00
Fedora Release Engineering
b6ab1d0ee4 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-20 21:26:49 +00:00
14 changed files with 199 additions and 31 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

View file

@ -9,10 +9,11 @@ diff -up at-3.1.23/atd.8.in.document-n at-3.1.23/atd.8.in
.RB [ \-s ]
.SH DESCRIPTION
.B atd
@@ -44,6 +45,10 @@ in the foreground.
@@ -44,6 +45,11 @@ in the foreground.
Process the at/batch queue only once.
This is primarily of use for compatibility with old versions of
.BR at ;
+.TP
+.B \-n
+Append the hostname of the system to the subject of the e-mails sent by
+.BR atd .

View file

@ -19,7 +19,7 @@ diff -ur b/atd.c a/atd.c
+ int fd_out, fd_in, fd_std;
char jobbuf[9];
char *mailname = NULL;
int mailsize = 128;
size_t mailsize = 128;
@@ -390,6 +393,10 @@
fcntl(fd_in, F_SETFD, fflags & ~FD_CLOEXEC);

View file

@ -0,0 +1,57 @@
From 43e8b5b5dd72bb9a80679dec8c15a24f00888a53 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= <jstanek@redhat.com>
Date: Wed, 26 Jun 2024 16:59:31 +0200
Subject: [PATCH] Address issues from static analyzer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- Tweak types in run_file() to prevent overflow
- Initialize all members of of struct tm in posix_time_parse().
The static analyzer findings: https://issues.redhat.com/browse/RHEL-44999
Signed-off-by: Jan Staněk <jstanek@redhat.com>
---
atd.c | 4 ++--
posixtm.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/atd.c b/atd.c
index 64fdd83..3908de3 100644
--- a/atd.c
+++ b/atd.c
@@ -279,7 +279,7 @@ run_file(const char *filename, uid_t uid, gid_t gid)
int fd_out, fd_in;
char jobbuf[9];
char *mailname = NULL;
- int mailsize = 128;
+ size_t mailsize = 128;
char *newname;
FILE *stream;
int send_mail = 0;
@@ -292,7 +292,7 @@ run_file(const char *filename, uid_t uid, gid_t gid)
char queue;
char fmt[64];
unsigned long jobno;
- int rc;
+ long rc;
#ifdef HAVE_PAM
int retcode;
#endif
diff --git a/posixtm.c b/posixtm.c
index cf4ec09..06b22fa 100644
--- a/posixtm.c
+++ b/posixtm.c
@@ -188,7 +188,7 @@ posix_time_parse (struct tm *tm, const char *s, unsigned int syntax_bits)
bool
posixtime (time_t *p, const char *s, unsigned int syntax_bits)
{
- struct tm tm0;
+ struct tm tm0 = {0};
struct tm tm1;
struct tm const *tm;
time_t t;
--
GitLab

View file

@ -23,7 +23,7 @@ diff -ur b/atd.c a/atd.c
@@ -301,6 +306,7 @@
char fmt[64];
unsigned long jobno;
int rc;
long rc;
+ char hostbuf[MAXHOSTNAMELEN];
#ifdef WITH_PAM
int retcode;

View file

@ -131,7 +131,7 @@ diff -ur b/atd.c a/atd.c
@@ -293,7 +289,7 @@
char fmt[64];
unsigned long jobno;
int rc;
long rc;
-#ifdef HAVE_PAM
+#ifdef WITH_PAM
int retcode;

33
at-3.2.5-past-date.patch Normal file
View file

@ -0,0 +1,33 @@
From 6c131df8c85cb2761faf551f8f9db179e216fc09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Poho=C5=99elsk=C3=BD?= <opohorel@redhat.com>
Date: Wed, 25 Jun 2025 14:35:31 +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 8d0feaa..3fb0582 100644
--- a/at.c
+++ b/at.c
@@ -951,6 +951,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);
+ }
break;
case 'o':
--
2.49.0

6
at-tmpfiles.conf Normal file
View file

@ -0,0 +1,6 @@
# at - Tmpfiles configuration for at daemon
# Create /var/spool/at directory structure for the at daemon
d /var/spool/at 0700 root root - -
d /var/spool/at/spool 0700 root root - -
f /var/spool/at/.SEQ 0600 root root - -

91
at.spec
View file

@ -3,18 +3,20 @@
Summary: Job spooling tools
Name: at
Version: 3.2.5
Release: 3%{?dist}
Release: 20%{?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
License: GPL-3.0-or-later AND GPL-2.0-or-later AND ISC
URL: http://ftp.debian.org/debian/pool/main/a/at
Source: http://software.calhariz.com/at/at_%{version}.orig.tar.gz
# git upstream source git://git.debian.org/git/collab-maint/at.git
Source1: pam_atd
Source2: at-tmpfiles.conf
Source3: atd.sysconf
Source5: atd.systemd
Patch: at-3.2.5-address-sast.patch
Patch: at-aarch64.patch
Patch: at-3.2.5-make.patch
Patch: at-3.2.5-pam.patch
@ -30,12 +32,14 @@ Patch: at-3.1.16-clear-nonjobs.patch
Patch: at-3.2.2-lock-locks.patch
Patch: at-3.1.23-document-n.patch
Patch: at-3.1.20-log-jobs.patch
Patch: at-3.2.5-past-date.patch
BuildRequires: gcc
BuildRequires: flex flex-static bison autoconf
BuildRequires: libselinux-devel >= 1.27.9
BuildRequires: perl(Test::Harness)
BuildRequires: perl(Test::More)
BuildRequires: systemd-rpm-macros
%if %{with pam}
BuildRequires: pam-devel
@ -86,7 +90,7 @@ make install \
DAEMON_USERNAME=`id -nu` \
DAEMON_GROUPNAME=`id -ng` \
DESTDIR=%{buildroot} \
sbindir=%{_prefix}/sbin \
sbindir=%{_bindir} \
bindir=%{_bindir} \
datadir=%{_datadir} \
prefix=%{_prefix} \
@ -113,18 +117,24 @@ install -m 644 %{SOURCE3} %{buildroot}/etc/sysconfig/atd
mkdir -p %{buildroot}/%{_unitdir}/
install -m 644 %{SOURCE5} %{buildroot}/%{_unitdir}/atd.service
# install tmpfiles configuration
mkdir -p %{buildroot}%{_tmpfilesdir}
install -m 644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/at.conf
# remove unpackaged files from the buildroot
rm -r %{buildroot}%{_prefix}/doc
# Remove .SEQ file created by make install - tmpfiles will create it
rm -f %{buildroot}%{_localstatedir}/spool/at/.SEQ
%check
make test
%post
touch %{_localstatedir}/spool/at/.SEQ
chmod 600 %{_localstatedir}/spool/at/.SEQ
chown root:root %{_localstatedir}/spool/at/.SEQ
%systemd_post atd.service
# Create directories and files using tmpfiles
%tmpfiles_create at.conf
%preun
%systemd_preun atd.service
@ -149,21 +159,78 @@ chown root:root %{_localstatedir}/spool/at/.SEQ
%doc README timespec ChangeLog
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/at.deny
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/atd
%attr(0700,root,root) %dir %{_localstatedir}/spool/at
%attr(0600,root,root) %verify(not md5 size mtime) %ghost %{_localstatedir}/spool/at/.SEQ
%attr(0700,root,root) %dir %{_localstatedir}/spool/at/spool
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/atd
%{_sbindir}/atrun
%attr(0755,root,root) %{_sbindir}/atd
%attr(0700,root,root) %dir %{_localstatedir}/spool/at
%attr(0700,root,root) %dir %{_localstatedir}/spool/at/spool
%{_tmpfilesdir}/at.conf
%{_bindir}/atrun
%attr(0755,root,root) %{_bindir}/atd
%{_mandir}/man*/*
%{_bindir}/batch
%{_bindir}/atrm
%{_bindir}/atq
%attr(4755,root,root) %{_bindir}/at
%{_datadir}/at/batch-job
%{_datadir}/at/
%attr(0644,root,root) /%{_unitdir}/atd.service
%changelog
* Fri Jan 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.5-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
* Thu Sep 18 2025 Ondřej Pohořelský <opohorel@redhat.com> - 3.2.5-19
- Add /var/spool/at and /var/spool/at/spool directories into %%files section
- Resolves: rhbz#2396330
* Wed Aug 27 2025 Ondřej Pohořelský <opohorel@redhat.com> - 3.2.5-18
- Use systemd-tmpfiles for /var/spool/at directories
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.5-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Wed Jun 25 2025 Ondřej Pohořelský <opohorel@redhat.com> - 3.2.5-16
- Fix past date handling with -t option
* Mon May 05 2025 Ondřej Pohořelský <opohorel@redhat.com> - 3.2.5-15
- Claim ownership of /usr/share/at
- Resolves: rhbz#2283298
* Mon Jan 27 2025 Ondřej Pohořelský <opohorel@redhat.com> - 3.2.5-14
- Unify bin and sbin directories
- Resolves: rhbz#2339910
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.5-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Thu Aug 8 2024 Ales Nezbeda <anezbeda@redhat.com> - 3.2.5-12
- Backport fixes from upstream PR
- https://salsa.debian.org/debian/at/-/merge_requests/34
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.5-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Thu May 02 2024 Ondřej Pohořelský <opohorel@redhat.com> - 3.2.5-10
- Corrected document-n patch
- Resolves: rhbz#2276918
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.5-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.5-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.5-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Mon Jun 26 2023 Ondřej Pohořelský <opohorel@redhat.com> - 3.2.5-6
- Convert licenses to SPDX format
- Dropped MIT and Public Domain license as they are not present in upstream sources
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Mar 31 2022 Jan Staněk <jstanek@redhat.com> - 3.2.5-3
- Add preceding newline to delimiter in at-3.2.2-shell.patch

5
plans/ci.fmf Normal file
View file

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

@ -1 +0,0 @@
Subproject commit 30cccc88a2064eb05018a09d65164a26972cd5b5

12
tests/initscript/main.fmf Normal file
View file

@ -0,0 +1,12 @@
summary: Initscript sanity
description: ''
contact: Radek Biba <rbiba@redhat.com>
component:
- at
test: ./runtest.sh
framework: beakerlib
recommend:
- at
duration: 5m
extra-summary: /CoreOS/at/Sanity/initscript
extra-task: /CoreOS/at/Sanity/initscript

View file

@ -27,7 +27,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include rhts environment
. /usr/share/rhts-library/rhtslib.sh
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="at"
SERVICE="atd"

View file

@ -1,13 +0,0 @@
---
# This first play always runs on the local staging system
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
- container
- atomic
tests:
- initscript
required_packages:
- at # Required to run initscript