Add (disabled) generation of authorized_keys
authorAndreas Barth <aba@not.so.argh.org>
Fri, 16 May 2008 17:40:19 +0000 (17:40 +0000)
committerAndreas Barth <aba@not.so.argh.org>
Fri, 16 May 2008 17:40:19 +0000 (17:40 +0000)
debian/changelog
ud-generate

index 7e241b5..acae76a 100644 (file)
@@ -1,8 +1,9 @@
 userdir-ldap (0.3.24) UNRELEASED; urgency=low
 
   * Add compatibility to dchroot-dsa to ud-replicate.
+  * Add (disabled) generation of authorized_keys suiteable for sshdist.
 
- -- Andreas Barth <aba@alioth.debian.org>  Fri, 16 May 2008 17:32:37 +0000
+ -- Andreas Barth <aba@not.so.argh.org>  Fri, 16 May 2008 17:35:19 +0000
 
 userdir-ldap (0.3.23) unstable; urgency=low
 
index f3ffc4c..ec618d8 100755 (executable)
@@ -702,7 +702,7 @@ def GenBSMTP(l,File,HomePrefix):
   Done(File,F,None);
 
 # Generate the ssh known hosts file
-def GenSSHKnown(l,File):
+def GenSSHKnown(l,File,mode=None):
   F = None;
   try:
    OldMask = os.umask(0022);
@@ -734,7 +734,11 @@ def GenSSHKnown(l,File):
         else: IPAdresses += [addr[1]]
 
       for I in x[1]["sshRSAHostKey"]:
-         Line = "%s %s" %(",".join(HostNames + IPAdresses), I);
+         if mode and mode == 'authorized_keys':
+            #Line = 'command="rsync --server --sender -pr . /var/cache/userdir-ldap/hosts/%s",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,from="%s" %s' % (Host, ",".join(HNames + IPAdresses), I)
+            Line = 'command="rsync --server --sender -pr . /var/cache/userdir-ldap/hosts/%s",no-port-forwarding,no-X11-forwarding,no-agent-forwarding %s' % (Host,I)
+         else:
+            Line = "%s %s" %(",".join(HostNames + IPAdresses), I);
          Line = Sanitize(Line) + "\n";
          F.write(Line);
   # Oops, something unspeakable happened.
@@ -823,6 +827,7 @@ GenMarkers(l,GlobalDir+"markers");
 GenPrivate(l,GlobalDir+"debian-private");
 GenDisabledAccounts(l,GlobalDir+"disabled-accounts");
 GenSSHKnown(l,GlobalDir+"ssh_known_hosts");
+#GenSSHKnown(l,GlobalDir+"authorized_keys", 'authorized_keys');
 GenHosts(l,GlobalDir+"debianhosts");
 GenMailDisable(l,GlobalDir+"mail-disable");
 GenMailBool(l,GlobalDir+"mail-greylist","mailGreylisting");