X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=blobdiff_plain;f=ud-mailgate;h=283ee2236f86078a7d01a34ad470959492d1c774;hp=87e2a04a69184ed77613df13589cfa1caf95af6a;hb=68e4c53262fd7ba07d517ac671375565f5904646;hpb=1fbe81444fcbb3f043ad5df7769fc53c7fd7cc00 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()))