From: Stephen Gran Date: Fri, 8 May 2009 23:40:59 +0000 (+0100) Subject: Stop exporting locked accounts X-Git-Tag: userdir-ldap-0.3.67~14^2~14 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=d66c40e3e08fe190c8f81c46114f5fda20a0eeba Stop exporting locked accounts --- diff --git a/ud-generate b/ud-generate index de97265..b3f0b58 100755 --- a/ud-generate +++ b/ud-generate @@ -33,6 +33,7 @@ global Allowed; global CurrentHost; PasswdAttrs = None; +disabledusers = [] GroupIDMap = {}; SubGroupMap = {}; Allowed = None; @@ -585,6 +586,7 @@ def GenDisabledAccounts(l,File): # Fetch all the users global PasswdAttrs; + global disabledusers if PasswdAttrs == None: raise "No Users"; @@ -604,6 +606,8 @@ def GenDisabledAccounts(l,File): if Line != "": F.write(Sanitize(Line) + "\n") + disabledusers.append(x) + # Oops, something unspeakable happened. except: Die(File,F,None); @@ -1058,6 +1062,8 @@ GenKeyrings(l,GlobalDir); # Compatibility. GenForward(l,GlobalDir+"forward-alias"); +PasswdAttrs = filter(lambda x: not x in disabledusers, PasswdAttrs) + while(1): Line = F.readline(); if Line == "":