DSA lists
authorjgg <>
Tue, 24 Apr 2001 02:36:11 +0000 (02:36 +0000)
committerjgg <>
Tue, 24 Apr 2001 02:36:11 +0000 (02:36 +0000)
ud-generate
ud-replicate

index 674cc60..f9f8841 100755 (executable)
@@ -181,6 +181,40 @@ def GenSSHShadow(l,File):
      raise "cdbmake gave an error";
   Done(File,F,None);
 
+def GenSSH2Shadow(l,File):
+  F = None;
+  Fdb = None;
+  try:
+   OldMask = os.umask(0077);
+   F = open(File + ".tmp","w",0600);
+   Fdb = os.popen("cdbmake %s.cdb %s.cdb.tmp"%(File,File),"w");
+   os.umask(OldMask);
+
+   # Fetch all the users
+   global PasswdAttrs;
+   if PasswdAttrs == None:
+      raise "No Users";
+
+   I = 0;
+   for x in PasswdAttrs:
+      if x[1].has_key("uidnumber") == 0 or \
+         x[1].has_key("sshdsaauthkey") == 0:
+         continue;
+      for I in x[1]["sshdsaauthkey"]:
+         User = GetAttr(x,"uid");
+         Line = "%s: %s" %(User,I);
+         Line = Sanitize(Line) + "\n";
+         F.write(Line);
+         Fdb.write("+%d,%d:%s->%s\n"%(len(User),len(I),User,I));
+   Fdb.write("\n");
+  # Oops, something unspeakable happened.
+  except:
+   Die(File,F,Fdb);
+   raise;
+  if Fdb.close() != None:
+     raise "cdbmake gave an error";
+  Done(File,F,None);
+  
 # Generate the group list
 def GenGroup(l,File):
   F = None;
@@ -462,7 +496,7 @@ PasswdAttrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"uid=*",\
                  "shadowmin","shadowmax","shadowwarning","shadowinactive",
                 "shadowexpire","emailforward","latitude","longitude",\
                  "allowedhosts","sshrsaauthkey","dnszoneentry","cn","sn",\
-                "keyfingerprint","privatesub"]);
+                "keyfingerprint","privatesub","sshdsaauthkey"]);
 
 # Open the control file
 if len(sys.argv) == 1:
@@ -472,6 +506,7 @@ else:
 
 # Generate global things
 GlobalDir = GenerateDir+"/";
+GenSSH2Shadow(l,GlobalDir+"ssh-dsa-shadow");
 GenSSHShadow(l,GlobalDir+"ssh-rsa-shadow");
 GenAllForward(l,GlobalDir+"mail-forward.cdb");
 GenMarkers(l,GlobalDir+"markers");
index 58f705b..ad7e55d 100755 (executable)
@@ -16,3 +16,4 @@ mv -f passwd.db.t passwd.db
 mv -f shadow.db.t shadow.db
 mv -f group.db.t group.db
 ln -sf $HOST/ssh-rsa-shadow . > /dev/null 2>&1
+ln -sf $HOST/ssh-dsa-shadow . > /dev/null 2>&1