From 5bef88f3d6253fc7109d753e9a48284fd420f504 Mon Sep 17 00:00:00 2001 From: Martin Zobel-Helas Date: Sat, 9 Mar 2013 00:30:07 +0100 Subject: [PATCH] disable dnsZoneEntry and privateSub for guest accounts Signed-off-by: Martin Zobel-Helas --- UDLdap.py | 3 +++ ud-generate | 2 ++ 2 files changed, 5 insertions(+) diff --git a/UDLdap.py b/UDLdap.py index 3c0f0ef..f19703f 100644 --- a/UDLdap.py +++ b/UDLdap.py @@ -87,6 +87,9 @@ class Account: def is_active_user(self): return self['accountStatus'] == 'active' and self.numkeys() != 0 + def is_guest_account(self): + return self['gidNumber'] == 60000 + def latitude_dec(self, anonymized=False): return userdir_ldap.DecDegree(self['latitude'], anonymized) def longitude_dec(self, anonymized=False): diff --git a/ud-generate b/ud-generate index 955757e..44bccc4 100755 --- a/ud-generate +++ b/ud-generate @@ -665,6 +665,7 @@ def GenPrivate(accounts, File): # Write out the position for each user for a in accounts: if not a.is_active_user(): continue + if a.is_guest_account(): continue if not 'privateSub' in a: continue try: Line = "%s"%(a['privateSub']) @@ -778,6 +779,7 @@ def GenDNS(accounts, File): for a in accounts: if not 'dnsZoneEntry' in a: continue if not a.is_active_user() and not isRoleAccount(a): continue + if a.is_guest_account(): continue try: F.write("; %s\n"%(a.email_address())) -- 2.20.1