diff options
author | Rich Megginson <rmeggins@redhat.com> | 2007-07-19 00:23:40 +0000 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2007-07-19 00:23:40 +0000 |
commit | a7a11d6bd8e81bd1b13098848f4d0a39d9912eeb (patch) | |
tree | 29e9f196768e3b20e97bb91e3ae54a22044b724f | |
parent | 9dc51a21f16bc27e5d50ff072d6c94c301227efc (diff) | |
download | ds-a7a11d6bd8e81bd1b13098848f4d0a39d9912eeb.tar.gz ds-a7a11d6bd8e81bd1b13098848f4d0a39d9912eeb.tar.xz ds-a7a11d6bd8e81bd1b13098848f4d0a39d9912eeb.zip |
Resolves: bug 248820
Bug Description: quick install failed when login userid doesn't match install user's id
Reviewed by: me
Fix Description: getlogin returns the _login_ ID which is the initial login id (from utmp). We want the username of the effective user ID, so I just needed to change getLogin to do that.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
-rw-r--r-- | ldap/admin/src/scripts/Util.pm.in | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ldap/admin/src/scripts/Util.pm.in b/ldap/admin/src/scripts/Util.pm.in index a4d50d8a..b6e3e0ea 100644 --- a/ldap/admin/src/scripts/Util.pm.in +++ b/ldap/admin/src/scripts/Util.pm.in @@ -111,8 +111,11 @@ sub isValidServerID { return $servid =~ /^[$validchars]+$/o; } +# we want the name of the effective user id of this process e.g. if someone did +# an su root, we want getLogin to return "root" not the originating id (getlogin) +# in perl, $> is the effective numeric user id - we need to turn it into a string sub getLogin { - return getlogin || (getpwuid($>))[0] || $ENV{USER} || die "Error: could not determine the current user ID: $!"; + return (getpwuid($>))[0] || $ENV{USER} || die "Error: could not determine the current user ID: $!"; } sub isValidUser { |