1.0.3 (upstream) is enough
[mirror/userdir-ldap.git] / ud-generate
index 16fe435..afc6b16 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- mode: python -*-
 # Generates passwd, shadow and group files from the ldap directory.
 
-import string, re, time, ldap, getopt, sys, os, pwd, posix;
+import string, re, time, ldap, getopt, sys, os, pwd, posix, socket;
 from userdir_ldap import *;
 
 PasswdAttrs = None;
@@ -463,9 +463,9 @@ def GenSSHKnown(l,File):
       SHost = string.find(Host,".");
       for I in x[1]["sshrsahostkey"]:
          if SHost == None:
-            Line = "%s,%s %s" %(Host,gethostbyname(Host),I);
+            Line = "%s,%s %s" %(Host,socket.gethostbyname(Host),I);
          else:
-            Line = "%s,%s,%s %s" %(Host,Host[0:SHost],,gethostbyname(Host),I);
+            Line = "%s,%s,%s %s" %(Host,Host[0:SHost],socket.gethostbyname(Host),I);
          Line = Sanitize(Line) + "\n";
          F.write(Line);
          Fdb.write("+%d,%d:%s->%s\n"%(len(Host),len(I),Host,I));