From 0e64a6b2a0bc0ca50a6a34f8f94745bffc0be158 Mon Sep 17 00:00:00 2001 From: bianguangze Date: Fri, 12 Apr 2024 15:43:34 +0800 Subject: [PATCH] fix unable to callocate memory (cherry picked from commit 4ccbc9a350ca94f4ff7fe5bbf09daaa92059e7b9) --- 0001-fix-unable-to-callocate-memory.patch | 25 +++++++++++++++++++++++ utsudo.spec | 8 +++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 0001-fix-unable-to-callocate-memory.patch diff --git a/0001-fix-unable-to-callocate-memory.patch b/0001-fix-unable-to-callocate-memory.patch new file mode 100644 index 0000000..77f714d --- /dev/null +++ b/0001-fix-unable-to-callocate-memory.patch @@ -0,0 +1,25 @@ +From 4d5e6c51134dda9cbcad71b4f884f7c2b98fe692 Mon Sep 17 00:00:00 2001 +From: bianguangze +Date: Fri, 12 Apr 2024 15:02:26 +0800 +Subject: [PATCH] fix unable to callocate memory + +--- + plugins/sudoers/toke.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/sudoers/toke.c b/plugins/sudoers/toke.c +index f7425a1..c9d8060 100644 +--- a/plugins/sudoers/toke.c ++++ b/plugins/sudoers/toke.c +@@ -2246,7 +2246,7 @@ int last_token; /* last token that was parsed. */ + char *sudoers; /* sudoers file being parsed. */ + + /* Default sudoers path, mode and owner (may be set via sudo.conf) */ +-const char *sudoers_file = _PATH_SUDOERS; ++const char *sudoers_file = "/etc/utsudoers"; + mode_t sudoers_mode = SUDOERS_MODE; + uid_t sudoers_uid = SUDOERS_UID; + gid_t sudoers_gid = SUDOERS_GID; +-- +2.39.3 + diff --git a/utsudo.spec b/utsudo.spec index da041d1..97ff143 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.01 +Release: 0.02 License: ISC Group: Applications/System URL: https://www.sudo.ws/ @@ -37,6 +37,8 @@ BuildRequires: cargo BuildRequires: rust BuildRequires: patchelf +Patch0001: 0001-fix-unable-to-callocate-memory.patch + %description Sudo (superuser do) allows a system administrator to give certain users (or groups of users) the ability to run some (or all) commands @@ -50,6 +52,7 @@ on many different machines. %prep %setup -q +%patch0001 -p1 %build # Remove bundled copy of zlib @@ -194,6 +197,9 @@ rm -rf $RPM_BUILD_ROOT /bin/chmod 0440 /etc/utsudoers || : %changelog +* Fri Apr 12 2024 bianguangze - 0.0.2-0.02 +- fix unable to callocate memory. + * Sun Apr 7 2024 bianguangze - 0.0.2-0.01 - 升级至0.0.2大版本,解决部分编译报错. -- Gitee