[packages/cronie] Rel 3. Backport upstream fixes for parsing and backups.
arekm
arekm at pld-linux.org
Thu Oct 29 08:28:14 CET 2026
commit 418b44b3a751d1e9de3091dccd7ce8be0678d19f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed Oct 28 23:52:58 2026 +0100
Rel 3. Backport upstream fixes for parsing and backups.
cronie.spec | 10 ++++++++--
crontab-backup-mkdir.patch | 38 ++++++++++++++++++++++++++++++++++++++
error-func-prototype.patch | 37 +++++++++++++++++++++++++++++++++++++
range-parsing.patch | 22 ++++++++++++++++++++++
4 files changed, 105 insertions(+), 2 deletions(-)
---
diff --git a/cronie.spec b/cronie.spec
index 7bf4fd7..127c5dd 100644
--- a/cronie.spec
+++ b/cronie.spec
@@ -18,7 +18,7 @@ Summary: Cron daemon for executing programs at set times
Summary(pl.UTF-8): Demon cron do uruchamiania programów o zadanym czasie
Name: cronie
Version: 1.7.2
-Release: 2
+Release: 3
License: MIT and BSD and GPL v2
Group: Daemons
#Source0Download: https://github.com/cronie-crond/cronie/releases
@@ -31,6 +31,9 @@ Source5: %{name}.pam
Source6: crond.service
Patch0: inotify-nosys.patch
Patch1: sendmail-path.patch
+Patch2: range-parsing.patch
+Patch3: crontab-backup-mkdir.patch
+Patch4: error-func-prototype.patch
URL: https://github.com/cronie-crond/cronie/
%{?with_audit:BuildRequires: audit-libs-devel}
BuildRequires: autoconf >= 2.60
@@ -50,7 +53,7 @@ Requires: psmisc >= 20.1
Requires: rc-scripts >= 0.4.3.0
%if "%{pld_release}" != "ac"
Requires(post,preun,postun): systemd-units >= 38
-Requires: systemd-units >= 38}
+Requires: systemd-units >= 38
%endif
%{?with_inotify:Requires: uname(release) >= 2.6.13}
Provides: crondaemon
@@ -107,6 +110,9 @@ anacrona, ale może to być zmienione w ustawieniach.
%setup -q
%patch -P0 -p1
%patch -P1 -p1
+%patch -P2 -p1
+%patch -P3 -p1
+%patch -P4 -p1
%build
%{__aclocal}
diff --git a/crontab-backup-mkdir.patch b/crontab-backup-mkdir.patch
new file mode 100644
index 0000000..c42554c
--- /dev/null
+++ b/crontab-backup-mkdir.patch
@@ -0,0 +1,38 @@
+From fd56df9b6d5fa9932edc6bd41d307e2453a6b442 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ond=C5=99ej=20Poho=C5=99elsk=C3=BD?= <opohorel at redhat.com>
+Date: Wed, 30 Jul 2025 12:40:17 +0200
+Subject: [PATCH] crontab: Fix backup failure when ~/.cache directory missing
+
+Create ~/.cache parent directory before creating ~/.cache/crontab backup
+directory to prevent "mkdir: No such file or directory" errors when users
+edit crontabs and their cache directory doesn't exist.
+---
+ src/crontab.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/src/crontab.c b/src/crontab.c
+index c11dc81..14d02dd 100644
+--- a/src/crontab.c
++++ b/src/crontab.c
+@@ -578,7 +578,21 @@ static int backup_crontab(const char *crontab_path) {
+ exit(ERROR_EXIT);
+ }
+
++ /* Ensure the backup directory and its parent exist, creating them if necessary */
+ if (stat(backup_dir, &sb) < OK && errno == ENOENT) {
++ char *last_slash = strrchr(backup_dir, '/');
++ if (last_slash && last_slash != backup_dir) {
++ char parent_dir[MAX_FNAME];
++ size_t parent_len = last_slash - backup_dir;
++ if (parent_len < sizeof(parent_dir)) {
++ strncpy(parent_dir, backup_dir, parent_len);
++ parent_dir[parent_len] = '\0';
++ /* Check if parent directory exists before creating */
++ if (stat(parent_dir, &sb) < OK && errno == ENOENT) {
++ mkdir(parent_dir, 0700);
++ }
++ }
++ }
+ if (OK != mkdir(backup_dir, 0755)) {
+ fprintf(stderr, "%s: ", backup_dir);
+ perror("mkdir");
diff --git a/error-func-prototype.patch b/error-func-prototype.patch
new file mode 100644
index 0000000..1988825
--- /dev/null
+++ b/error-func-prototype.patch
@@ -0,0 +1,37 @@
+From 09c630c654b2aeff06a90a412cce0a60ab4955a4 Mon Sep 17 00:00:00 2001
+From: Tomas Mraz <tmraz at fedoraproject.org>
+Date: Mon, 18 Nov 2024 21:02:30 +0100
+Subject: [PATCH] load_entry(): Make error_func prototype complete
+
+Fixes #193
+---
+ src/entry.c | 2 +-
+ src/funcs.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/entry.c b/src/entry.c
+index 586eb9d..a2077e8 100644
+--- a/src/entry.c
++++ b/src/entry.c
+@@ -90,7 +90,7 @@ void free_entry(entry * e) {
+ /* return NULL if eof or syntax error occurs;
+ * otherwise return a pointer to a new entry.
+ */
+-entry *load_entry(FILE * file, void (*error_func) (), struct passwd *pw,
++entry *load_entry(FILE * file, void (*error_func) (const char *), struct passwd *pw,
+ char **envp) {
+ /* this function reads one crontab entry -- the next -- from a file.
+ * it skips any leading blank lines, ignores comments, and returns
+diff --git a/src/funcs.h b/src/funcs.h
+index 427e027..f28d634 100644
+--- a/src/funcs.h
++++ b/src/funcs.h
+@@ -89,7 +89,7 @@ char *env_get(const char *, char **),
+ user *load_user(int, struct passwd *, const char *, const char *, const char *),
+ *find_user(cron_db *, const char *, const char *);
+
+-entry *load_entry(FILE *, void (*)(), struct passwd *, char **);
++entry *load_entry(FILE *, void (*)(const char *), struct passwd *, char **);
+
+ FILE *cron_popen(char *, const char *, struct passwd *, char **);
+
diff --git a/range-parsing.patch b/range-parsing.patch
new file mode 100644
index 0000000..104285c
--- /dev/null
+++ b/range-parsing.patch
@@ -0,0 +1,22 @@
+Range parsing fixes from upstream: Sunday as 0 ends a day-of-week range
+(fri-sun), reversed ranges are rejected instead of silently never matching.
+https://github.com/cronie-crond/cronie/commit/d0370421
+https://github.com/cronie-crond/cronie/commit/e6c28538
+https://github.com/cronie-crond/cronie/commit/1c3f74e7
+https://github.com/cronie-crond/cronie/commit/6126a7b3
+
+--- cronie-1.7.2.orig/src/entry.c 2023-10-13 10:38:39.000000000 +0200
++++ cronie-1.7.2/src/entry.c 2026-10-28 23:51:44.432458409 +0100
+@@ -634,6 +634,12 @@ get_range(bitstr_t * bits, int low, int
+ return (EOF);
+
+ case R_RANGE_NUM2:
++ if (low_ > high_ && high_ == 0 && high == LAST_DOW) {
++ high_ = 7;
++ }
++ if (low_ > high_) {
++ return (EOF);
++ }
+ if (ch == '/') {
+ state = R_STEP;
+ break;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/cronie.git/commitdiff/418b44b3a751d1e9de3091dccd7ce8be0678d19f
More information about the pld-cvs-commit
mailing list