Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17397
Modified Files:
Util.pm.in
Log Message:
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
Index: Util.pm.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/Util.pm.in,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Util.pm.in 13 Jul 2007 19:51:48 -0000 1.9
+++ Util.pm.in 19 Jul 2007 00:23:40 -0000 1.10
@@ -111,8 +111,11 @@
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 {
Show replies by thread