소스 검색

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
 # Look up the primary group name for the supplied user
 sub getGroup {
 sub getGroup {
     my $user = shift;
     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 {
 sub isValidUser {