X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-generate;h=ba282b960adddfc478d061eaee513789001b91a2;hb=c7155ff59b036167ec936e26670c8ec9cfb83646;hp=4a0fd51f304923c6563f314300aa1deeefb3df77;hpb=108188be721a6e5cf678918d530143aa71dad2d3;p=mirror%2Fuserdir-ldap.git diff --git a/ud-generate b/ud-generate index 4a0fd51..ba282b9 100755 --- a/ud-generate +++ b/ud-generate @@ -408,6 +408,10 @@ def GenDNS(l,File,HomePrefix): for x in PasswdAttrs: if x[1].has_key("dnsZoneEntry") == 0: continue; + + # If the account has no PGP key, do not write it + if x[1].has_key("keyFingerPrint") == 0: + continue; try: F.write("; %s\n"%(EmailAddress(x))); for z in x[1]["dnsZoneEntry"]: @@ -459,6 +463,10 @@ def GenBSMTP(l,File,HomePrefix): for x in PasswdAttrs: if x[1].has_key("dnsZoneEntry") == 0: continue; + + # If the account has no PGP key, do not write it + if x[1].has_key("keyFingerPrint") == 0: + continue; try: for z in x[1]["dnsZoneEntry"]: Split = string.split(string.lower(z)); @@ -536,8 +544,11 @@ def GenHosts(l,File): if x[1].has_key("hostname") == 0: continue; Host = GetAttr(x,"hostname"); - Addr = socket.gethostbyname(Host); - F.write(Addr + "\n"); + try: + Addr = socket.gethostbyname(Host); + F.write(Addr + "\n"); + except: + pass # Oops, something unspeakable happened. except: Die(File,F,None);