From 8aa9e8c38186c8447e6825839ef2f784f3ad9815 Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Aug 13 2013 21:40:08 +0000 Subject: 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!) --- 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 {