opt out spam filtering
[mirror/userdir-ldap.git] / ud-generate
index 2ad4791..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):
@@ -910,10 +907,6 @@ def GenSSHKnown(l,File,mode=None):
       if Host.endswith(HostDomain):
          HostNames.append(Host[:-(len(HostDomain)+1)])
 
-      #<weasel> [[]] makes http links
-      #<weasel> but integrating it somehow into the purpose line might be a good idea
-      #<weasel> maybe [[*fooobar]] things would be a link but not added to the ssh key list,
-      #         and [[-..]] or something would be just an ssh entry but no link
       # in the purpose field [[host|some other text]] (where some other text is optional)
       # makes a hyperlink on the web thing. we now also add these hosts to the ssh known_hosts
       # file.  But so that we don't have to add everything we link we can add an asterisk