From: Stephen Gran Date: Sat, 9 May 2009 12:56:29 +0000 (+0100) Subject: Some reordering of file generation so that we can do fewer redundant checks X-Git-Tag: userdir-ldap-0.3.67~14^2~7 X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=2fea3b6ff06f1cc758e97fd9340fa7303e92ff1b;hp=c82d57f1f3641dac4c2b763b9093c590f2fa245b;p=mirror%2Fuserdir-ldap.git Some reordering of file generation so that we can do fewer redundant checks --- diff --git a/ud-generate b/ud-generate index 1e8b392..693e563 100755 --- a/ud-generate +++ b/ud-generate @@ -295,9 +295,8 @@ def GenShadowSudo(l, File, untrusted): Done(File, F, None) # Generate the shadow list -def GenSSHShadow(l): +def GenSSHShadow(): # Fetch all the users - singlefile = None userfiles = [] global PasswdAttrs @@ -307,9 +306,6 @@ def GenSSHShadow(l): for x in PasswdAttrs: - if x in DisabledUsers: - continue - if x[1].has_key("uidNumber") == 0 or \ x[1].has_key("sshRSAAuthKey") == 0: continue @@ -1058,7 +1054,7 @@ else: # Generate global things GlobalDir = GenerateDir + "/" -GenMailDisable(l, GlobalDir + "mail-disable") +GenDisabledAccounts(l, GlobalDir + "disabled-accounts") for x in PasswdAttrs: if IsRetired(x): @@ -1068,14 +1064,10 @@ PasswdAttrs = filter(lambda x: not x in RetiredUsers, PasswdAttrs) CheckForward() -SSHFiles = GenSSHShadow(l) +GenMailDisable(l, GlobalDir + "mail-disable") GenAllForward(l, GlobalDir + "mail-forward.cdb") -GenMarkers(l, GlobalDir + "markers") GenPrivate(l, GlobalDir + "debian-private") -GenDisabledAccounts(l, GlobalDir + "disabled-accounts") -GenSSHKnown(l, GlobalDir + "ssh_known_hosts") #GenSSHKnown(l,GlobalDir+"authorized_keys", 'authorized_keys') -GenHosts(l, GlobalDir + "debianhosts") GenMailBool(l, GlobalDir + "mail-greylist", "mailGreylisting") GenMailBool(l, GlobalDir + "mail-callout", "mailCallout") GenMailList(l, GlobalDir + "mail-rbl", "mailRBL") @@ -1088,6 +1080,11 @@ GenForward(l, GlobalDir + "forward-alias") PasswdAttrs = filter(lambda x: not x in DisabledUsers, PasswdAttrs) +SSHFiles = GenSSHShadow() +GenMarkers(l, GlobalDir + "markers") +GenSSHKnown(l, GlobalDir + "ssh_known_hosts") +GenHosts(l, GlobalDir + "debianhosts") + while(1): Line = F.readline() if Line == "":