diff --git a/SOURCES/cronie-1.4.11-inherit-path.patch b/SOURCES/cronie-1.4.11-inherit-path.patch new file mode 100644 index 0000000..ec42692 --- /dev/null +++ b/SOURCES/cronie-1.4.11-inherit-path.patch @@ -0,0 +1,25 @@ +diff --git a/src/entry.c b/src/entry.c +index 3638207..ce37756 100644 +--- a/src/entry.c ++++ b/src/entry.c +@@ -343,8 +343,18 @@ entry *load_entry(FILE * file, void (*error_func) (), struct passwd *pw, + e->envp = tenvp; + #ifndef LOGIN_CAP + /* If login.conf is in used we will get the default PATH later. */ +- if (ChangePath && !env_get("PATH", e->envp)) { +- if (glue_strings(envstr, sizeof envstr, "PATH", _PATH_DEFPATH, '=')) { ++ if (!env_get("PATH", e->envp)) { ++ char *defpath; ++ ++ if (ChangePath) ++ defpath = _PATH_DEFPATH; ++ else { ++ defpath = getenv("PATH"); ++ if (defpath == NULL) ++ defpath = _PATH_DEFPATH; ++ } ++ ++ if (glue_strings(envstr, sizeof envstr, "PATH", defpath, '=')) { + if ((tenvp = env_set(e->envp, envstr)) == NULL) { + ecode = e_memory; + goto eof; diff --git a/SOURCES/cronie-1.4.11-restart-on-failure.patch b/SOURCES/cronie-1.4.11-restart-on-failure.patch new file mode 100644 index 0000000..5e9a7ff --- /dev/null +++ b/SOURCES/cronie-1.4.11-restart-on-failure.patch @@ -0,0 +1,12 @@ +diff -ru cronie-1.4.11/contrib/cronie.systemd cronie-1.4.11_patched/contrib/cronie.systemd +--- cronie-1.4.11/contrib/cronie.systemd 2018-11-27 15:26:46.797288342 +0100 ++++ cronie-1.4.11_patched/contrib/cronie.systemd 2018-11-27 15:26:19.479159225 +0100 +@@ -7,6 +7,8 @@ + ExecStart=/usr/sbin/crond -n $CRONDARGS + ExecReload=/bin/kill -HUP $MAINPID + KillMode=process ++Restart=on-failure ++RestartSec=30s + + [Install] + WantedBy=multi-user.target diff --git a/SOURCES/cronie-1.4.11-smartcard-auth.patch b/SOURCES/cronie-1.4.11-smartcard-auth.patch new file mode 100644 index 0000000..931ed39 --- /dev/null +++ b/SOURCES/cronie-1.4.11-smartcard-auth.patch @@ -0,0 +1,14 @@ +diff -ru cronie-1.4.11/pam/crond cronie-1.4.11_patched/pam/crond +--- cronie-1.4.11/pam/crond 2013-07-18 14:27:08.000000000 +0200 ++++ cronie-1.4.11_patched/pam/crond 2018-12-04 16:01:53.220225842 +0100 +@@ -4,7 +4,7 @@ + # + # No PAM authentication called, auth modules not needed + account required pam_access.so +-account include password-auth ++account include system-auth + session required pam_loginuid.so +-session include password-auth +-auth include password-auth ++session include system-auth ++auth include system-auth diff --git a/SPECS/cronie.spec b/SPECS/cronie.spec index fc9da10..99168de 100644 --- a/SPECS/cronie.spec +++ b/SPECS/cronie.spec @@ -6,7 +6,7 @@ Summary: Cron daemon for executing programs at set times Name: cronie Version: 1.4.11 -Release: 20%{?dist} +Release: 23%{?dist} License: MIT and BSD and ISC and GPLv2+ Group: System Environment/Base URL: https://github.com/cronie-crond/cronie @@ -28,6 +28,9 @@ Patch12: cronie-1.4.11-selinux-user.patch Patch13: cronie-1.4.11-no-pam.patch Patch14: cronie-1.4.11-empty-var.patch Patch15: cronie-1.4.11-race-on-crontab-modification.patch +Patch16: cronie-1.4.11-inherit-path.patch +Patch17: cronie-1.4.11-smartcard-auth.patch +Patch18: cronie-1.4.11-restart-on-failure.patch Requires: dailyjobs @@ -108,6 +111,9 @@ extra features. %patch13 -p1 -b .no-pam %patch14 -p1 -b .empty-var %patch15 -p1 -b .race-cond +%patch16 -p1 -b .inherit-path +%patch17 -p1 -b .smartcard-auth +%patch18 -p1 -b .restart %build %configure \ @@ -232,6 +238,19 @@ exit 0 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cron.d/dailyjobs %changelog +* Wed Feb 13 2019 Marcel Plch - 1.4.11-23 +- Make cronie restart on failure +- Resolves: rhbz#1651730 + +* Tue Dec 04 2018 Marcel Plch - 1.4.11-22 +- Backport upstream patch to fix cron failing on + smart card authentication +- Resolves: rhbz#1650314 + +* Thu Nov 29 2018 Marcel Plch - 1.4.11-21 +- Backport upstream patch to fix -P behavior +- Resolves: rhbz#1536111 + * Tue Oct 23 2018 Marcel Plch - 1.4.11-20 - Fix race condition when crontab is modified the same second before and after reading the crontab