Bugzilla – Attachment 852183 Details for
Bug 1186602
latest pam_mount affects zypper and sudo su
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
Patch in case a PTF is needed
0001-Avoid-calling-su-to-detect-a-too-restrictive-sudo-us.patch (text/plain), 1.46 KB, created by
Michael Andres
on 2021-08-31 12:31:47 UTC
(
hide
)
Description:
Patch in case a PTF is needed
Filename:
MIME Type:
Creator:
Michael Andres
Created:
2021-08-31 12:31:47 UTC
Size:
1.46 KB
patch
obsolete
>From fa78bf473b20b9d8b8cf00a5f41a08bb109f5e10 Mon Sep 17 00:00:00 2001 >From: Michael Andres <ma@suse.de> >Date: Tue, 31 Aug 2021 14:24:27 +0200 >Subject: [PATCH] Avoid calling 'su' to detect a too restrictive sudo user > umask (bsc#1186602) > >Assume 0022 for root. >--- > src/main.cc | 14 ++++---------- > 1 file changed, 4 insertions(+), 10 deletions(-) > >diff --git a/src/main.cc b/src/main.cc >index 28df2e9c..29e2acdb 100644 >--- a/src/main.cc >+++ b/src/main.cc >@@ -105,16 +105,10 @@ int main( int argc, char **argv ) > std::string sudouser { env::SUDO_USER() }; > if ( ! sudouser.empty() ) { > sudo = true; >- PathInfo su { "/usr/bin/su" }; >- if ( su.isFile() && su.userMayRX() ) { >- std::string umaskstr { ExternalProgram( { su.asString(), "-c", "umask", "-l", "root" }, ExternalProgram::Discard_Stderr ).receiveLine() }; >- if ( zypp::str::regex("^0[0-7]{3}$").matches( umaskstr.c_str() ) ) { >- mode_t mask = str::strtonum<mode_t>( umaskstr ); >- mode_t omask = ::umask( mask ); >- if ( mask != omask ) >- std::cerr << "zypper: adjusting umask " << str::octstring(omask,3) << " of sudo-user " << sudouser << " to " << str::octstring(mask,3) << " for user root." << endl; >- } >- } >+ mode_t mask = 0022; >+ mode_t omask = ::umask( mask ); >+ if ( mask != omask ) >+ std::cerr << "zypper: adjusting umask " << str::octstring(omask,3) << " of sudo-user " << sudouser << " to " << str::octstring(mask,3) << " for user root." << endl; > } > } > >-- >2.26.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 1186602
:
849981
| 852183