From 2bd13c1294d782f1399dbba69b0e3a6f2114363d Mon Sep 17 00:00:00 2001 From: wxiat Date: Fri, 28 Jul 2023 13:58:27 +0800 Subject: [PATCH] cherry-pick `add sw arch #67f107f94b2ae4b6376e750103f8f5fd1f3e6b31`. Signed-off-by: wxiat Signed-off-by: Weisson --- sudo-1.8.29-sw.patch | 82 ++++++++++++++++++++++++++++++++++++++++++++ sudo.spec | 7 +++- 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 sudo-1.8.29-sw.patch diff --git a/sudo-1.8.29-sw.patch b/sudo-1.8.29-sw.patch new file mode 100644 index 0000000..eeda7a7 --- /dev/null +++ b/sudo-1.8.29-sw.patch @@ -0,0 +1,82 @@ +From 0f3214637df9b301c9614a2004ab4e3a010c88c8 Mon Sep 17 00:00:00 2001 +From: wxiat +Date: Thu, 21 Mar 2024 11:35:46 +0800 +Subject: [PATCH] add sw support. + +Signed-off-by: wxiat +Signed-off-by: Weisson +--- + include/compat/endian.h | 2 +- + plugins/sudoers/auth/secureware.c | 6 +++--- + plugins/sudoers/getspwuid.c | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/include/compat/endian.h b/include/compat/endian.h +index d3c5ca9..feecbcf 100644 +--- a/include/compat/endian.h ++++ b/include/compat/endian.h +@@ -45,7 +45,7 @@ + # define BYTE_ORDER LITTLE_ENDIAN + # elif defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN__) + # define BYTE_ORDER BIG_ENDIAN +-# elif defined(__alpha__) || defined(__alpha) || defined(__amd64) || \ ++# elif defined(__alpha__) || defined(__alpha) || defined(__sw_64__) || defined(__sw_64) || defined(__amd64) || \ + defined(BIT_ZERO_ON_RIGHT) || defined(i386) || defined(__i386) || \ + defined(MIPSEL) || defined(_MIPSEL) || defined(ns32000) || \ + defined(__ns3200) || defined(sun386) || defined(vax) || \ +diff --git a/plugins/sudoers/auth/secureware.c b/plugins/sudoers/auth/secureware.c +index dd7aa42..a7f6046 100644 +--- a/plugins/sudoers/auth/secureware.c ++++ b/plugins/sudoers/auth/secureware.c +@@ -46,7 +46,7 @@ + #include "sudoers.h" + #include "sudo_auth.h" + +-#ifdef __alpha ++#if defined __alpha || defined __sw_64 + extern int crypt_type; + #endif + +@@ -55,7 +55,7 @@ sudo_secureware_init(struct passwd *pw, sudo_auth *auth) + { + debug_decl(sudo_secureware_init, SUDOERS_DEBUG_AUTH); + +-#ifdef __alpha ++#ifdef __alpha || defined __sw_64 + if (crypt_type == INT_MAX) + debug_return_int(AUTH_FAILURE); /* no shadow */ + #endif +@@ -77,7 +77,7 @@ sudo_secureware_verify(struct passwd *pw, char *pass, sudo_auth *auth, struct su + if (pass[0] == '\0') + debug_return_int(pw_epasswd[0] ? AUTH_FAILURE : AUTH_SUCCESS); + +-#if defined(__alpha) ++#if defined(__alpha) || defined(__sw_64) + # ifdef HAVE_DISPCRYPT + epass = dispcrypt(pass, pw_epasswd, crypt_type); + # else +diff --git a/plugins/sudoers/getspwuid.c b/plugins/sudoers/getspwuid.c +index 650b3f3..f31dd5f 100644 +--- a/plugins/sudoers/getspwuid.c ++++ b/plugins/sudoers/getspwuid.c +@@ -51,7 +51,7 @@ + /* + * Exported for auth/secureware.c + */ +-#if defined(HAVE_GETPRPWNAM) && defined(__alpha) ++#if defined(HAVE_GETPRPWNAM) && (defined(__alpha) || defined(__sw_64)) + int crypt_type = INT_MAX; + #endif /* HAVE_GETPRPWNAM && __alpha */ + +@@ -87,7 +87,7 @@ sudo_getepw(const struct passwd *pw) + struct pr_passwd *spw; + + if ((spw = getprpwnam(pw->pw_name)) && spw->ufld.fd_encrypt) { +-# ifdef __alpha ++# if defined __alpha || defined __sw_64 + crypt_type = spw->ufld.fd_oldcrypt; + # endif /* __alpha */ + epw = spw->ufld.fd_encrypt; +-- +2.31.1 + diff --git a/sudo.spec b/sudo.spec index c60d6f0..210c769 100644 --- a/sudo.spec +++ b/sudo.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 Summary: Allows restricted root access for specified users Name: sudo Version: 1.9.5p2 @@ -54,6 +54,7 @@ Patch18: linker.patch Patch19: sudo-1.9.15-CVE-2023-42465.patch Patch20: sudo-1.9.12p1-CVE-2022-43955.patch +Patch27: sudo-1.8.29-sw.patch %description Sudo (superuser do) allows a system administrator to give certain @@ -101,6 +102,7 @@ plugins that use %{name}. %patch -P 19 -p1 -b .rowhammer %patch -P 20 -p1 -b .CVE-2022-43955 +%patch27 -p1 %build # Remove bundled copy of zlib @@ -276,6 +278,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man8/sudo_plugin.8* %changelog +* Wed Mar 20 2024 wxiat - 1.9.5p2-1.0.2 +- cherry-pick `add sw arch #67f107f94b2ae4b6376e750103f8f5fd1f3e6b31`. + * Mon Mar 04 2024 guo chuang - 1.9.5p2-1.0.1 - add patch for CVE-2022-43955 -- Gitee