From 68e4c53262fd7ba07d517ac671375565f5904646 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Fri, 22 Jan 2010 23:51:24 +0100 Subject: [PATCH] write machine specifications for ssh keys to ldap --- ud-mailgate | 5 +++++ 1 file changed, 5 insertions(+) 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())) -- 2.20.1