projects
/
mirror
/
userdir-ldap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1fbe814
)
write machine specifications for ssh keys to ldap
author
Helmut Grohne
<helmut@subdivi.de>
Fri, 22 Jan 2010 22:51:24 +0000
(23:51 +0100)
committer
Stephen Gran
<steve@lobefin.net>
Sun, 24 Jan 2010 19:13:52 +0000
(19:13 +0000)
ud-mailgate
patch
|
blob
|
history
diff --git
a/ud-mailgate
b/ud-mailgate
index
87e2a04
..
283ee22
100755
(executable)
--- 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 "
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:
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)
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()))
# Head
Date = time.strftime("%a, %d %b %Y %H:%M:%S +0000",time.gmtime(time.time()))