[Da-tools-commits] ./debian/userdir-ldap r477: ud-generate: Support $gid@$host supplementary group entries for users.

Peter Palfrader peter at palfrader.org
Sat Nov 15 10:20:24 UTC 2008


------------------------------------------------------------
revno: 477
committer: Peter Palfrader <peter at palfrader.org>
branch nick: userdir-ldap
timestamp: Sat 2008-11-15 11:20:24 +0100
message:
  ud-generate: Support $gid@$host supplementary group entries for users.
modified:
  debian/changelog
  ud-generate
-------------- next part --------------
=== modified file 'debian/changelog'
--- a/debian/changelog	2008-11-14 22:15:31 +0000
+++ b/debian/changelog	2008-11-15 10:20:24 +0000
@@ -1,3 +1,9 @@
+userdir-ldap (0.3.50) unstable; urgency=low
+
+  * ud-generate: Support $gid@$host supplementary group entries for users.
+
+ -- Peter Palfrader <weasel at debian.org>  Sat, 15 Nov 2008 11:20:09 +0100
+
 userdir-ldap (0.3.49) unstable; urgency=low
 
   * ud-replicate: Only link ssh-rsa-shadow to var/lib/misc/$host and etc/ssh

=== modified file 'ud-generate'
--- a/ud-generate	2008-11-14 22:05:23 +0000
+++ b/ud-generate	2008-11-15 10:20:24 +0000
@@ -89,7 +89,11 @@
 
   # Check the supplementary groups
   for I in DnRecord[1]["supplementaryGid"]:
-     if Allowed.has_key(I):
+     s = I.split('@', 1)
+     group = s[0]
+     if len(s) == 2 and s[1] != CurrentHost:
+           continue;
+     if Allowed.has_key(group):
         return 1;
   return 0;
 
@@ -376,10 +380,14 @@
          continue;
 
       for I in x[1]["supplementaryGid"]:
-         if GroupMap.has_key(I):
-            GroupMap[I].append(GetAttr(x,"uid"));
+         s = I.split('@', 1)
+         group = s[0]
+         if len(s) == 2 and s[1] != CurrentHost:
+            continue;
+         if GroupMap.has_key(group):
+            GroupMap[group].append(GetAttr(x,"uid"));
          else:
-            print "Group does not exist ",I,"but",GetAttr(x,"uid"),"is in it";
+            print "Group does not exist ",group,"but",GetAttr(x,"uid"),"is in it";
 
    # Output the group file.
    J = 0;



More information about the Da-tools-commits mailing list