import UBI at-3.2.5-13.el10_0

This commit is contained in:
eabdullin 2025-08-05 06:44:18 +00:00
parent 58fc74e3e7
commit cdf650be43
2 changed files with 39 additions and 1 deletions

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

View File

@ -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ý <opohorel@redhat.com> - 3.2.5-13
- Add patch to fix past date handling
- Resolves: RHEL-100334
* Wed Nov 06 2024 Ondřej Pohořelský <opohorel@redhat.com> - 3.2.5-12
- Address issues from static analyzer
Resolves: RHEL-44999