Bug 27773 - su enhancement
Summary: su enhancement
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: sh-utils
Version: 7.1
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-02-15 11:23 UTC by e
Modified: 2007-04-18 16:31 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-01-25 00:36:29 UTC
Embargoed:


Attachments (Terms of Use)
su ruser patch (697 bytes, patch)
2001-02-15 11:26 UTC, e
no flags Details | Diff

Description e 2001-02-15 11:23:55 UTC
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 e 2001-02-15 11:26:01 UTC
Created attachment 10081 [details]
su ruser patch

Comment 2 Bernhard Rosenkraenzer 2002-01-25 00:36:23 UTC
Thanks, added in 2.0.11-8.

Comment 3 Bernhard Rosenkraenzer 2002-02-21 13:19:47 UTC
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.