瀏覽代碼

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 年之前
父節點
當前提交
8aa9e8c381
共有 1 個文件被更改,包括 7 次插入2 次删除
  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 {