diff --git a/logrotate-3.16.0p1-switch-user-checkpoint.patch b/logrotate-3.16.0p1-switch-user-checkpoint.patch new file mode 100644 index 0000000000000000000000000000000000000000..166b3c0f31d8469cb18f7ebfbe849085fa99b53f --- /dev/null +++ b/logrotate-3.16.0p1-switch-user-checkpoint.patch @@ -0,0 +1,15 @@ +diff -Nura logrotate-3.16.0/logrotate.c logrotate-3.16.0.fix/logrotate.c +--- logrotate-3.16.0/logrotate.c 2020-02-06 19:28:00.000000000 +0800 ++++ logrotate-3.16.0.fix/logrotate.c 2022-03-04 16:43:47.167877229 +0800 +@@ -187,8 +187,9 @@ + return 1; + } + +- if (setuid(ROOT_UID) != -1) { +- message(MESS_ERROR, "failed to switch user permanently, able to switch back\n"); ++ if (user != ROOT_UID && setuid(ROOT_UID) != -1) { ++ message(MESS_ERROR, "failed to switch user permanently, able to switch back (pid %d)\n", ++ getpid()); + return 1; + } + diff --git a/logrotate.spec b/logrotate.spec index 8e18866669d654133e7ea4b5f997c1f731f90a86..985763cae32d6480f29b11e86e5496c29b9bd746 100644 --- a/logrotate.spec +++ b/logrotate.spec @@ -2,11 +2,12 @@ Name: logrotate Version: 3.16.0 -Release: 1 +Release: 2 Summary: simplify the administration of log files License: GPLv2+ Url: https://github.com/logrotate/logrotate Source0: https://github.com/logrotate/logrotate/releases/download/%{version}/logrotate-%{version}.tar.xz +Patch0: logrotate-3.16.0p1-switch-user-checkpoint.patch BuildRequires: acl gcc automake libacl-devel libselinux-devel popt-devel Requires: coreutils @@ -73,6 +74,10 @@ fi %{_mandir}/man5/logrotate.conf.5* %changelog +* Fri Mar 4 2022 Yang Tao +- Fix the switch user permanently checkpoint issue, the solution is ported from 3.18.1. +- update version to 3.16.0-1. + * Fri Apr 24 2020 BruceGW - 3.16.0-1 - update upstream to 3.16.0