PasswdAttrs = None
DisabledUsers = []
-RetiredUsers = []
GroupIDMap = {}
SubGroupMap = {}
Allowed = None
return False
+def IsGidDebian(x):
+ try:
+ return int(GetAttr(x, "gidNumber", 0)) == 800
+ except ValueError:
+ return False
+
# See if this user is in the group list
def IsInGroup(DnRecord):
if Allowed == None:
return grouprevmap
def CheckForward():
- global PasswdAttrs
- for x in PasswdAttrs:
+ global DebianUsers
+ for x in DebianUsers:
if x[1].has_key("emailForward") == 0:
continue
os.umask(OldMask)
# Fetch all the users
- global PasswdAttrs
+ global DebianUsers
# Write out the email address for each user
- for x in PasswdAttrs:
+ for x in DebianUsers:
if x[1].has_key("emailForward") == 0:
continue
os.umask(OldMask)
# Fetch all the users
- global PasswdAttrs
+ global DebianUsers
# Write out the email address for each user
- for x in PasswdAttrs:
+ for x in DebianUsers:
if x[1].has_key("emailForward") == 0:
continue
F = open(File + ".tmp", "w")
# Fetch all the users
- global PasswdAttrs
+ global DebianUsers
# Write out the position for each user
- for x in PasswdAttrs:
+ for x in DebianUsers:
if x[1].has_key("latitude") == 0 or x[1].has_key("longitude") == 0:
continue
try:
F = open(File + ".tmp", "w")
# Fetch all the users
- global PasswdAttrs
+ global DebianUsers
# Write out the position for each user
- for x in PasswdAttrs:
+ for x in DebianUsers:
if x[1].has_key("privateSub") == 0:
continue
if x[1].has_key("keyFingerPrint") == 0:
continue
- # Must be in the Debian group (yuk, hard coded for now)
- if GetAttr(x, "gidNumber") != "800":
- continue
-
try:
Line = "%s"%(GetAttr(x, "privateSub"))
Line = Sanitize(Line) + "\n"
F = open(File + ".tmp", "w")
# Fetch all the users
- global PasswdAttrs
+ global DebianUsers
- for x in PasswdAttrs:
+ for x in DebianUsers:
Reason = None
if x[1].has_key("mailDisableMessage"):
else:
continue
- # Must be in the Debian group (yuk, hard coded for now)
- if GetAttr(x, "gidNumber") != "800":
- continue
-
try:
Line = "%s: %s"%(GetAttr(x, "uid"), Reason)
Line = Sanitize(Line) + "\n"
F = open(File + ".tmp", "w")
# Fetch all the users
- global PasswdAttrs
+ global DebianUsers
- for x in PasswdAttrs:
+ for x in DebianUsers:
Reason = None
if x[1].has_key(Key) == 0:
continue
- # Must be in the Debian group (yuk, hard coded for now)
- if GetAttr(x, "gidNumber") != "800":
- continue
-
if GetAttr(x, Key) != "TRUE":
continue
F = open(File + ".tmp", "w")
# Fetch all the users
- global PasswdAttrs
+ global DebianUsers
- for x in PasswdAttrs:
+ for x in DebianUsers:
Reason = None
if x[1].has_key(Key) == 0:
continue
- # Must be in the Debian group (yuk, hard coded for now)
- if GetAttr(x, "gidNumber") != "800":
- continue
-
try:
found = 0
Line = None
F = open(File + ".tmp", "w")
# Fetch all the users
- global PasswdAttrs
+ global DebianUsers
# Write out the zone file entry for each user
- for x in PasswdAttrs:
+ for x in DebianUsers:
if x[1].has_key("dnsZoneEntry") == 0:
continue
GlobalDir = GenerateDir + "/"
GenDisabledAccounts(GlobalDir + "disabled-accounts")
-for x in PasswdAttrs:
- if IsRetired(x):
- RetiredUsers.append(x)
-
-PasswdAttrs = filter(lambda x: not x in RetiredUsers, PasswdAttrs)
+PasswdAttrs = filter(not IsRetired, PasswdAttrs)
+DebianUsers = filter(IsGidDebian, PasswdAttrs)
CheckForward()