diff --git a/at-3.2.5-past-date.patch b/at-3.2.5-past-date.patch new file mode 100644 index 0000000..6344c40 --- /dev/null +++ b/at-3.2.5-past-date.patch @@ -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?= +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 + diff --git a/at.spec b/at.spec index 0baaac6..5b89172 100644 --- a/at.spec +++ b/at.spec @@ -3,7 +3,7 @@ Summary: Job spooling tools Name: at Version: 3.2.5 -Release: 12%{?dist} +Release: 13%{?dist} # http://packages.debian.org/changelogs/pool/main/a/at/current/copyright # + install-sh is MIT license with changes under Public Domain License: GPL-3.0-or-later AND GPL-2.0-or-later AND ISC @@ -31,6 +31,7 @@ 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-address-issues-from-static-analyzer.patch +Patch: at-3.2.5-past-date.patch BuildRequires: gcc BuildRequires: flex flex-static bison autoconf @@ -165,6 +166,10 @@ chown root:root %{_localstatedir}/spool/at/.SEQ %attr(0644,root,root) /%{_unitdir}/atd.service %changelog +* Mon Jun 30 2025 Ondřej Pohořelský - 3.2.5-13 +- Add patch to fix past date handling +- Resolves: RHEL-100334 + * Wed Nov 06 2024 Ondřej Pohořelský - 3.2.5-12 - Address issues from static analyzer Resolves: RHEL-44999