Bug 27773 - su enhancement
su enhancement
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: sh-utils (Show other bugs)
7.1
All Linux
medium Severity low
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-02-15 06:23 EST by Emmanuel Galanos
Modified: 2007-04-18 12:31 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-01-24 19:36:29 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
su ruser patch (697 bytes, patch)
2001-02-15 06:26 EST, Emmanuel Galanos
no flags Details | Diff

  None (edit)
Description Emmanuel Galanos 2001-02-15 06:23:55 EST
Please apply this small patch to su to set PAM_RUSER.
Compiled and tested.

BTW pam_listfile core dumps if an argument passed to it does not contain
'=' .


--- sh-utils-2.0/src/su.c.old	Thu Feb 15 04:08:25 2001
+++ sh-utils-2.0/src/su.c	Thu Feb 15 04:08:35 2001
@@ -317,6 +317,8 @@
 correct_password (const struct passwd *pw)
 {
 #ifdef USE_PAM
+  struct passwd *caller;
+
   /* root always succeeds; this isn't an authentication question (no
    * extra privs are being granted) so it shouldn't authenticate with PAM.
    * However, we want to create the pam_handle so that proper credentials
@@ -331,6 +333,11 @@
 	exit(1);
   }

+  caller = getpwuid(getuid());
+  if (caller != NULL && caller->pw_name != NULL) {
+
retval = pam_set_item(pamh, PAM_RUSER, caller->pw_name);
+
PAM_BAIL_P;
+  }

   retval = pam_authenticate(pamh, 0);
   PAM_BAIL_P;
Comment 1 Emmanuel Galanos 2001-02-15 06:26:01 EST
Created attachment 10081 [details]
su ruser patch
Comment 2 Bernhard Rosenkraenzer 2002-01-24 19:36:23 EST
Thanks, added in 2.0.11-8.
Comment 3 Bernhard Rosenkraenzer 2002-02-21 08:19:47 EST
Oops, forgot to close the bug after fixing it.

Note You need to log in before you can comment on or make changes to this bug.