Do not call FinishConfirmSudopassword if we already decided to not commit this
[mirror/userdir-ldap.git] / ud-generate
index 0f95186..f1ed0b0 100755 (executable)
@@ -91,13 +91,10 @@ def IsInGroup(DnRecord):
   if DnRecord[1].has_key("supplementaryGid") == 0:
      return 0;
 
-  # Check the supplementary groups
-  for I in DnRecord[1]["supplementaryGid"]:
-     s = I.split('@', 1)
-     group = s[0]
-     if len(s) == 2 and s[1] != CurrentHost:
-           continue;
-     if Allowed.has_key(group):
+  supgroups=[]
+  addGroups(supgroups, DnRecord[1]["supplementaryGid"], GetAttr(DnRecord,"uid"))
+  for g in supgroups:
+     if Allowed.has_key(g):
         return 1;
   return 0;
 
@@ -376,13 +373,13 @@ def addGroups(existingGroups, newGroups, uid):
         continue
 
       if not GroupIDMap.has_key(group):
-         print "Group does not exist ",group,"but",uid,"is in it"
+         print "Group", group, "does not exist but", uid, "is in it"
          continue
 
       existingGroups.append(group)
 
       if SubGroupMap.has_key(group):
-         addGroups(existingGroups, SubGroupMap[group])
+         addGroups(existingGroups, SubGroupMap[group], uid)
 
 # Generate the group list
 def GenGroup(l,File):