[Da-tools-commits] ./da-tools/userdir-ldap-common r360: Merge passwordless export fix

Marc 'HE' Brockschmidt he at debian.org
Wed Dec 26 22:41:38 UTC 2007


------------------------------------------------------------
revno: 360
committer: Marc 'HE' Brockschmidt <he at debian.org>
branch nick: userdir-ldap-common
timestamp: Wed 2007-12-26 23:41:38 +0100
message:
  Merge passwordless export fix
modified:
  ud-generate
    ------------------------------------------------------------
    revno: 353.1.1
    committer: Marc 'HE' Brockschmidt <he at debian.org>
    branch nick: userdir-ldap-UIDShift+PasswordLessExport
    timestamp: Wed 2007-12-26 23:38:22 +0100
    message:
      Mark that no passwords are exported also in the generated passwd file, not
      only in the shadow file (by using a "*" as password (meaning "no password),
      instead of "x" (meaning "do I look like a passwd from the nineties? Look
      into /etc/shadow!")).
    modified:
      ud-generate
-------------- next part --------------
=== modified file 'ud-generate'
--- a/ud-generate	2007-12-26 20:49:42 +0000
+++ b/ud-generate	2007-12-26 22:41:38 +0000
@@ -88,7 +88,7 @@
     os.rename(File + ".tdb.tmp",File+".tdb");
   
 # Generate the password list
-def GenPasswd(l,File,HomePrefix):
+def GenPasswd(l,File,HomePrefix,PwdMarker):
   F = None;
   try:
    F = open(File + ".tdb.tmp","w");
@@ -107,7 +107,8 @@
       if len(GetAttr(x,"gecos")) > 100 or len(GetAttr(x,"loginShell")) > 50:
          continue;
 
-      Line = "%s:x:%s:%s:%s:%s%s:%s" % (GetAttr(x,"uid"),\
+      Line = "%s:%s:%s:%s:%s:%s%s:%s" % (GetAttr(x,"uid"),\
+              PwdMarker,\
               GetAttr(x,"uidNumber"),GetAttr(x,"gidNumber"),\
               GetAttr(x,"gecos"),HomePrefix,GetAttr(x,"uid"),\
               GetAttr(x,"loginShell"));
@@ -852,7 +853,10 @@
    DoLink(GlobalDir,OutDir,"disabled-accounts")
 
    sys.stdout.flush();
-   GenPasswd(l,OutDir+"passwd",Split[1]);
+   if ExtraList.has_key("[NOPASSWD]"):
+      GenPasswd(l,OutDir+"passwd",Split[1], "*");
+   else:
+      GenPasswd(l,OutDir+"passwd",Split[1], "x");
    sys.stdout.flush();
    GenGroup(l,OutDir+"group");
    if ExtraList.has_key("[UNTRUSTED]"):



More information about the Da-tools-commits mailing list