diff --git a/0003-fix-use_utsudo-A-error.patch b/0003-fix-use_utsudo-A-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..52de4d5d002b7ff7e2f0b57b411c42b33ba77d95 --- /dev/null +++ b/0003-fix-use_utsudo-A-error.patch @@ -0,0 +1,34 @@ +From 003b10476eea89178de048fb79e6d4a47109ce85 Mon Sep 17 00:00:00 2001 +From: bianguangze +Date: Tue, 11 Mar 2025 17:30:48 +0800 +Subject: [PATCH] bgz test patch + +--- + src/tgetpass.rs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/tgetpass.rs b/src/tgetpass.rs +index d519d69..a9e6494 100644 +--- a/src/tgetpass.rs ++++ b/src/tgetpass.rs +@@ -244,7 +244,7 @@ pub unsafe extern "C" fn tgetpass( + + fflush(stdout); + if askpass.is_null() { +- askpass = getenv_unhooked(b"SUDO_ASKPASS\0" as *const u8 as *const libc::c_char); ++ askpass = getenv_unhooked(b"UTSUDO_ASKPASS\0" as *const u8 as *const libc::c_char); + if askpass.is_null() || *askpass as libc::c_int == '\0' as i32 { + askpass = sudo_conf_askpass_path_v1(); + } +@@ -272,7 +272,7 @@ pub unsafe extern "C" fn tgetpass( + if ISSET!(flags, TGP_ASKPASS) != 0 { + if askpass.is_null() || *askpass as libc::c_int == '\0' as i32 { + sudo_fatalx!( +- b"no askpass program specified, try setting SUDO_ASKPASS\0" as *const u8 ++ b"no askpass program specified, try setting UTSUDO_ASKPASS\0" as *const u8 + as *const libc::c_char, + ); + } +-- +2.48.1 + diff --git a/0004-fix-use_utsudo-T-error.patch b/0004-fix-use_utsudo-T-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..d7ec9c99ed692ba8e08b6da4c402296b27ccba4a --- /dev/null +++ b/0004-fix-use_utsudo-T-error.patch @@ -0,0 +1,39 @@ +From 6f0a0eeceb673aaebab4dbb29d556557798963bf Mon Sep 17 00:00:00 2001 +From: bianguangze +Date: Wed, 12 Mar 2025 10:02:27 +0800 +Subject: [PATCH] T + +--- + lib/util/src/sudo_conf.rs | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lib/util/src/sudo_conf.rs b/lib/util/src/sudo_conf.rs +index 3023640..4078901 100644 +--- a/lib/util/src/sudo_conf.rs ++++ b/lib/util/src/sudo_conf.rs +@@ -174,18 +174,21 @@ macro_rules! _PATH_SUDO_NOEXEC { + } + + // # define _PATH_SUDO_PLUGIN_DIR "/usr/libexec/utsudo/" +-#[cfg(target_arch = "x86_64")] ++//#[cfg(target_arch = "x86_64")] + macro_rules! _PATH_SUDO_PLUGIN_DIR { + () => { + (b"/usr/libexec/utsudo/\0" as *const u8 as *const libc::c_char as *mut libc::c_char) + }; + } ++ ++/* + #[cfg(not(target_arch = "x86_64"))] + macro_rules! _PATH_SUDO_PLUGIN_DIR { + () => { + (b"/usr/libexec/sudo/\0" as *const u8 as *const libc::c_char as *mut libc::c_char) + }; + } ++*/ + + macro_rules! _PATH_SUDO_DEVSEARCH { + () => { +-- +2.48.1 + diff --git a/utsudo.spec b/utsudo.spec index 465ff09eabd7ddd5c088575a8928152ef984465a..98dbc3b1ab12961eb2496f814353097fcde808d5 100644 --- a/utsudo.spec +++ b/utsudo.spec @@ -3,7 +3,7 @@ ExcludeArch: i686 Summary: The tudo respect sudo Name: utsudo Version: 0.0.2 -Release: 0.03 +Release: 0.04 License: ISC Group: Applications/System URL: https://www.sudo.ws/ @@ -39,6 +39,8 @@ BuildRequires: patchelf Patch0001: 0001-fix-unable-to-callocate-memory.patch Patch0002: 0002-fix-use_pty-function-error.patch +Patch0003: 0003-fix-use_utsudo-A-error.patch +Patch0004: 0004-fix-use_utsudo-T-error.patch %description Sudo (superuser do) allows a system administrator to give certain @@ -55,6 +57,8 @@ on many different machines. %setup -q %patch0001 -p1 %patch0002 -p1 +%patch0003 -p1 +%patch0004 -p1 %build # Remove bundled copy of zlib @@ -199,6 +203,10 @@ rm -rf $RPM_BUILD_ROOT /bin/chmod 0440 /etc/utsudoers || : %changelog +* Wed Mar 12 2025 bianguangze - 0.0.2-0.04 +- Add Patch: 0003-fix-use_utsudo-A-error.patch +- Add Patch: 0004-fix-use_utsudo-T-error.patch + * Sun Apr 28 2024 binlingyu - 0.0.2-0.03 - Add Patch: 0002-fix-use_pty-function-error.patch