Browse Source

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!)
Mark Reynolds 12 năm trước cách đây
mục cha
commit
8aa9e8c381
1 tập tin đã thay đổi với 7 bổ sung2 xóa
  1. 7 2
      ldap/admin/src/scripts/DSUtil.pm.in

+ 7 - 2
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 {