--- /dev/null
+#!/bin/sh
+set -e
+
+sed -e "s/[1-9].*; Serial.*$/`date +%Y%m%d00` ; Serial/" < $1 > $1.new
+mv -f $1.new $1
+ndc reload 2>&1 /dev/null
+
it() supplementarygid - A list of group names that the user belongs.
This field emulates the functionality of the traditional Unix group
file. [root]
+ it() dnszoneentry - A list of zone file fragments that are placed in
+ the zone file for debian.net. [root]
it() allowedhosts - Permits access to hosts outside of the group list. [root]
it() onvacation - A message indicating that the user is on vacation. The
time of departure and expected return date should be included as
UserDn = "uid=" + AdminUser + "," + BaseDn;
l.simple_bind_s(UserDn,Password);
-# Read the override file into the unknown map. The override file is a list
-# of colon delimited entires mapping PGP email addresess to local users
List = open(arguments[1],"r");
while(1):
Line = List.readline();
if Line == "":
break;
+
Split = re.split("[:\n]",Line);
Rec = [(ldap.MOD_REPLACE,arguments[0],string.strip(Split[1]))];
if PasswdAttrs == None:
raise "No Users";
- # Write out the email address for each user
+ # Write out the position for each user
for x in PasswdAttrs:
if x[1].has_key("latitude") == 0 or x[1].has_key("longitude") == 0:
continue;
raise;
Done(File,F,Fdb);
+# Generate the DNS Zone file
+def GenDNS(l,File):
+ F = None;
+ Fdb = None;
+ try:
+ F = open(File + ".tmp","w");
+ Fdb = None;
+
+ # Fetch all the users
+ global PasswdAttrs;
+ if PasswdAttrs == None:
+ raise "No Users";
+
+ # Write out the zone file entry for each user
+ for x in PasswdAttrs:
+ if x[1].has_key("dnszoneentry") == 0:
+ continue;
+ try:
+ F.write("; %s\n"%(EmailAddress(x)));
+ for z in x[1]["dnszoneentry"]:
+ Split = string.split(string.lower(z));
+ for y in range(0,len(Split)):
+ if Split[y] == "$":
+ Split[y] = "\n\t";
+
+ Line = string.join(Split," ") + "\n";
+ F.write(Line);
+ F.write("\n");
+ except:
+ pass;
+
+ # Oops, something unspeakable happened.
+ except:
+ Die(F,Fdb);
+ raise;
+ Done(File,F,Fdb);
+
# Connect to the ldap server
l = ldap.open(LDAPServer);
F = open(PassDir+"/pass-"+pwd.getpwuid(posix.getuid())[0],"r");
"gecos","loginshell","userpassword","shadowlastchange",\
"shadowmin","shadowmax","shadowwarning","shadowinactive",
"shadowexpire","emailforward","latitude","longitude",\
- "allowedhosts","sshrsaauthkey"]);
+ "allowedhosts","sshrsaauthkey","dnszoneentry","cn","sn"]);
# Open the control file
if len(sys.argv) == 1:
# Get the group list and convert any named groups to numerics
GroupList = {};
+ ExtraList = {};
for I in Split[2:]:
+ if I[0] == '[':
+ ExtraList[I] = None;
+ continue;
GroupList[I] = None;
if GroupIDMap.has_key(I):
GroupList[str(GroupIDMap[I])] = None;
GenForward(l,OutDir+"forward-alias");
GenMarkers(l,OutDir+"markers");
+ if ExtraList.has_key("[DNS]"):
+ GenDNS(l,OutDir+"dns-zone");
+
"latitude": ["Latitude",12],
"longitude": ["Longitude",13],
"comment": ["Comment",114],
- "userpassword": ["Crypted Password",115]};
+ "userpassword": ["Crypted Password",115],
+ "dnszoneentry": ["d.net Entry",116]};
AttrPrompt = {"cn": ["Common name or first name"],
"mn": ["Middle name (or initial if it ends in a dot)"],
"member": ["LDAP Group Member for slapd ACLs"],
"latitude": ["XEarth latitude in ISO 6709 format - see /usr/share/zoneinfo/zone.tab or etak.com"],
"longitude": ["XEarth latitude in ISO 6709 format - see /usr/share/zoneinfo/zone.tab or etak.com"],
+ "dnszoneentry": ["DNS Zone fragment associated this this user"],
"labeledurl": ["Web home page"]};
# Create a map of IDs to desc,value,attr
# Change a single attribute
def ChangeAttr(Attrs,Attr):
- if (Attr == "supplementarygid" or Attr == "allowedhosts" or Attr == "member"):
+ if (Attr == "supplementarygid" or Attr == "allowedhosts" or \
+ Attr == "member" or Attr == "dnszoneentry"):
return MultiChangeAttr(Attrs,Attr);
print "Old value: '%s'" % (GetAttr(Attrs,Attr,""));
makedb $HOST/passwd.tdb -o passwd.db > /dev/null 2>&1
makedb $HOST/shadow.tdb -o shadow.db > /dev/null 2>&1
makedb $HOST/group.tdb -o group.db > /dev/null 2>&1
+ln -sf $HOST/ssh-rsa-shadow . > /dev/null 2>&1