ldap/admin/src/scripts/DSUtil.pm.in | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
New commits:
commit a7bdcc535b213455b785be004153c51b71ccc3be
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Aug 13 16:39:57 2013 -0400
Ticket 47473 - setup-ds.pl doesn't lookup the "root" group correctly
Bug Description: Silent install will fail, if you set the
"SuiteSpotUserID"
to root, but do not set "SuiteSpotGroup".
Fix Description: The root gid is zero, and this incorrectly triggered an
error that cancelled the install. Fix is to check if the
user info is set, instead of checking the group id value;
https://fedorahosted.org/389/ticket/47473
Reviewed by: richm(Thanks!)
(cherry picked from commit 8aa9e8c38186c8447e6825839ef2f784f3ad9815)
diff --git a/ldap/admin/src/scripts/DSUtil.pm.in b/ldap/admin/src/scripts/DSUtil.pm.in
index b971dac..eaf5e4b 100644
--- a/ldap/admin/src/scripts/DSUtil.pm.in
+++ b/ldap/admin/src/scripts/DSUtil.pm.in
@@ -160,8 +160,13 @@ sub getLogin {
# Look up the primary group name for the supplied user
sub getGroup {
my $user = shift;
- my $gid = (getpwnam($user))[3] || confess "Error: could not determine the
current group ID: $!";
- return (getgrgid($gid))[0] || confess "Error: could not determine the current
group name: $!";
+ my @userinfo = getpwnam($user);
+
+ if(!@userinfo){
+ confess "Error: could not find user ID ($user): $!";
+ }
+
+ return (getgrgid($userinfo[3]))[0] || confess "Error: could not determine the
current group name from gid ($userinfo[3]): $!";
}
sub isValidUser {