EmailCheck = re.compile("^([^ <>@]+@[^ ,<>@]+)?$")
BSMTPCheck = re.compile(".*mx 0 (master)\.debian\.org\..*",re.DOTALL)
PurposeHostField = re.compile(r".*\[\[([\*\-]?[a-z0-9.\-]*)(?:\|.*)?\]\]")
+IsV6Addr = re.compile("^[a-fA-F0-9:]+$")
DNSZone = ".debian.net"
Keyrings = ConfModule.sync_keyrings.split(":")
for x in HostAttrs:
if x[1].has_key("hostname") == 0 or \
+ x[1].has_key("architecture") == 0 or\
x[1].has_key("sshRSAHostKey") == 0:
continue
Host = GetAttr(x, "hostname")
+ Arch = GetAttr(x, "architecture")
Algorithm = None
+
for I in x[1]["sshRSAHostKey"]:
Split = I.split()
if Split[0] == 'ssh-rsa':
Line = "%s. IN SSHFP %u 1 %s" % (Host, Algorithm, Fingerprint)
Line = Sanitize(Line) + "\n"
F.write(Line)
+
+ Mach = ""
+ if x[1].has_key("machine"):
+ Mach = " " + GetAttr(x, "machine")
+ Line = "%s. IN HINFO \"%s%s\" \"%s\"" % (Host, Arch, Mach, "Debian GNU/Linux")
+ Line = Sanitize(Line) + "\n"
+ F.write(Line)
+
+ if x[1].has_key("ipHostNumber"):
+ for I in x[1]["ipHostNumber"]:
+ if IsV6Addr.match(I) != None:
+ Line = "%s. IN AAAA %s" % (Host, I)
+ else:
+ Line = "%s. IN A %s" % (Host, I)
+ Line = Sanitize(Line) + "\n"
+ F.write(Line)
+
+ if x[1].has_key("mXRecord"):
+ for I in x[1]["mXRecord"]:
+ Line = "%s. IN MX %s" % (Host, I)
+ Line = Sanitize(Line) + "\n"
+ F.write(Line)
+
# Oops, something unspeakable happened.
except:
Die(File, F, None)
# Fetch all the hosts
HostAttrs = l.search_s(HostBaseDn, ldap.SCOPE_ONELEVEL, "objectClass=debianServer",\
- ["hostname", "sshRSAHostKey", "purpose", "allowedGroups", "exportOptions"])
+ ["hostname", "sshRSAHostKey", "purpose", "allowedGroups", "exportOptions",\
+ "mXRecord", "ipHostNumber", "machine", "architecture"])
# Generate global things
GlobalDir = GenerateDir + "/"