Fix is_guest_account for the usergroups transition
authorPaul Wise <pabs@debian.org>
Mon, 13 Jun 2016 00:26:19 +0000 (08:26 +0800)
committerPaul Wise <pabs@debian.org>
Mon, 13 Jun 2016 01:49:59 +0000 (09:49 +0800)
Prevents guest accounts from using debian-private and debian.net

UDLdap.py

index f19703f..e917542 100644 (file)
--- a/UDLdap.py
+++ b/UDLdap.py
@@ -88,7 +88,7 @@ class Account:
         return self['accountStatus'] == 'active' and self.numkeys() != 0
 
     def is_guest_account(self):
         return self['accountStatus'] == 'active' and self.numkeys() != 0
 
     def is_guest_account(self):
-        return self['gidNumber'] == 60000
+        return 'guest' in self['supplementaryGid']
 
     def latitude_dec(self, anonymized=False):
         return userdir_ldap.DecDegree(self['latitude'], anonymized)
 
     def latitude_dec(self, anonymized=False):
         return userdir_ldap.DecDegree(self['latitude'], anonymized)