From f19068d0ebe30bd2b27e3875ca14373a93dc0e23 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 5 Aug 2025 05:07:00 +0000 Subject: [PATCH] import UBI at-3.1.23-12.el9_6 --- SOURCES/at-3.1.23-past-date.patch | 33 +++++++++++++++++++++++++++++++ SPECS/at.spec | 7 ++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 SOURCES/at-3.1.23-past-date.patch diff --git a/SOURCES/at-3.1.23-past-date.patch b/SOURCES/at-3.1.23-past-date.patch new file mode 100644 index 0000000..c1cb3de --- /dev/null +++ b/SOURCES/at-3.1.23-past-date.patch @@ -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?= +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 + diff --git a/SPECS/at.spec b/SPECS/at.spec index 1b20d24..ce54a6f 100644 --- a/SPECS/at.spec +++ b/SPECS/at.spec @@ -3,7 +3,7 @@ Summary: Job spooling tools Name: at Version: 3.1.23 -Release: 11%{?dist} +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 @@ -33,6 +33,7 @@ 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 +Patch: at-3.1.23-past-date.patch BuildRequires: gcc BuildRequires: flex flex-static bison autoconf @@ -166,6 +167,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.1.23-12 +- Add patch to fix past date handling +- Resolves: RHEL-97024 + * Fri Apr 01 2022 Jan Staněk - 3.1.23-10 - Add preceding newline to delimiter in at-3.1.20-shell.patch Resolves: rhbz#2070858