From 0681e6e93d9d21b85a67c4a4b81a9bd3dde848a5 Mon Sep 17 00:00:00 2001 From: Marc 'HE' Brockschmidt Date: Wed, 26 Dec 2007 23:38:22 +0100 Subject: [PATCH] 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!")). --- ud-generate | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ud-generate b/ud-generate index 3a9840b..55d05cf 100755 --- a/ud-generate +++ b/ud-generate @@ -88,7 +88,7 @@ def Done(File,F,Fdb): 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 @@ def GenPasswd(l,File,HomePrefix): 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 @@ while(1): 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]"): -- 2.20.1