From: Helmut Grohne Date: Fri, 22 Jan 2010 22:51:24 +0000 (+0100) Subject: write machine specifications for ssh keys to ldap X-Git-Tag: userdir-ldap-0.3.76~5 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=68e4c53262fd7ba07d517ac671375565f5904646 write machine specifications for ssh keys to ldap --- diff --git a/ud-mailgate b/ud-mailgate index 87e2a04..283ee22 100755 --- a/ud-mailgate +++ b/ud-mailgate @@ -281,6 +281,7 @@ def DoSSH(Str, Attrs, badkeys, uid): return None; # lines can now be prepended with "allowed_hosts=machine1,machine2 " + machines = [] if Str.startswith("allowed_hosts="): Str = Str.split("=", 1)[1] if ' ' not in Str: @@ -303,6 +304,10 @@ def DoSSH(Str, Attrs, badkeys, uid): if (result != 0): raise UDExecuteError, "ssh-keygen -l invocation failed!\n%s\n" % (output) + # format the string again for ldap: + if machines: + Str = "allowed_hosts=%s %s" % (",".join(machines), Str) + # Head Date = time.strftime("%a, %d %b %Y %H:%M:%S +0000",time.gmtime(time.time()))