From a049d2c52160bf19df237bcd5f261d3d1b9c2de5 Mon Sep 17 00:00:00 2001 From: zou_lin77 <422351577@qq.com> Date: Fri, 29 Jan 2021 11:17:32 +0800 Subject: [PATCH] Fix runstatedir handling for distros that do not support it --- ...g-for-distros-that-do-not-support-it.patch | 43 +++++++++++++++++++ sudo.spec | 9 +++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 backport-Fix-runstatedir-handling-for-distros-that-do-not-support-it.patch diff --git a/backport-Fix-runstatedir-handling-for-distros-that-do-not-support-it.patch b/backport-Fix-runstatedir-handling-for-distros-that-do-not-support-it.patch new file mode 100644 index 0000000..cf5a9ea --- /dev/null +++ b/backport-Fix-runstatedir-handling-for-distros-that-do-not-support-it.patch @@ -0,0 +1,43 @@ +From 92e5d81943c890d3ea4b9c140d968563c63b8309 Mon Sep 17 00:00:00 2001 +From: Evan Anderson +Date: Sun, 6 Sep 2020 14:30:54 -0500 +Subject: [PATCH] configure: Fix runstatedir handling for distros that do not + support it + +runstatedir was added in yet-to-be released autoconf 2.70. Some distros +are shipping this addition in their autoconf packages, but others, such as Fedora, +are not. This causes the rundir variable to be set incorrectly if the configure script +is regenerated with an unpatched autoconf since the runstatedir variable set is deleted +after regeneration. This change works around that problem by checking that runstatedir +is non-empty before potentially using it to set the rundir variable +--- + configure | 2 +- + m4/sudo.m4 | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 0f6ceb16c..2e0838e01 100755 +--- a/configure ++++ b/configure +@@ -26718,7 +26718,7 @@ EOF + $as_echo_n "checking for sudo run dir location... " >&6; } + if test -n "$with_rundir"; then + rundir="$with_rundir" +-elif test "$runstatedir" != '${localstatedir}/run'; then ++elif test -n "$runstatedir" && test "$runstatedir" != '${localstatedir}/run'; then + rundir="$runstatedir/sudo" + else + # No --with-rundir or --runstatedir specified +diff --git a/m4/sudo.m4 b/m4/sudo.m4 +index a5a972b3c..b3a40b208 100644 +--- a/m4/sudo.m4 ++++ b/m4/sudo.m4 +@@ -120,7 +120,7 @@ dnl + AC_DEFUN([SUDO_RUNDIR], [AC_MSG_CHECKING(for sudo run dir location) + if test -n "$with_rundir"; then + rundir="$with_rundir" +-elif test "$runstatedir" != '${localstatedir}/run'; then ++elif test -n "$runstatedir" && test "$runstatedir" != '${localstatedir}/run'; then + rundir="$runstatedir/sudo" + else + # No --with-rundir or --runstatedir specified diff --git a/sudo.spec b/sudo.spec index 41b0166..7cd6fe4 100644 --- a/sudo.spec +++ b/sudo.spec @@ -1,6 +1,6 @@ Name: sudo Version: 1.9.2 -Release: 2 +Release: 3 Summary: Allows restricted root access for specified users License: ISC URL: http://www.courtesan.com/sudo/ @@ -18,6 +18,7 @@ Patch4: backport-0002-CVE-2021-3156-Add-sudoedit-flag-checks.patch Patch5: backport-0003-CVE-2021-3156-Fix-potential-buffer-overflow.patch Patch6: backport-0004-CVE-2021-3156-Fix-the-memset-offset.patch Patch7: backport-0005-CVE-2021-3156-Dont-assume-that-argv.patch +Patch8: backport-Fix-runstatedir-handling-for-distros-that-do-not-support-it.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: pam @@ -158,6 +159,12 @@ install -p -c -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/sudo-i %exclude %{_pkgdocdir}/ChangeLog %changelog +* Fri Jan 29 2021 zoulin - 1.9.2-3 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:Fix runstatedir handling for distros that do not support it + * Wed Jan 27 2021 panxiaohe - 1.9.2-2 - Type:cves - ID:NA -- Gitee