From: Peter Palfrader Date: Thu, 10 Jan 2008 15:03:07 +0000 (+0100) Subject: Merge packaging cleanup from alioth (including template dir install location fix) X-Git-Tag: userdir-ldap-0.3.16~6 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=3b326c4bc7733d8993f418db2bf59ff9c4a7c752;hp=256243200336d330bc08d4e9fa3ae30427893c05 Merge packaging cleanup from alioth (including template dir install location fix) --- diff --git a/debian/changelog b/debian/changelog index 64a6dcd..c6fc647 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,8 @@ userdir-ldap (0.3.15+xxx) XXunstable; urgency=low * ud-generate: Set shadow expiry to 1 for locked accounts. * update doc/slapd-config.txt: labeledURL was removed from the schema but not the slapd.conf example. Do that now. + * add simple ud-config script for use in shell scripts. This allows + querying config values. [ Marc 'HE' Brockschmidt ] * Make the host ud-replicate syncs from configurable in userdir-ldap.conf, @@ -36,6 +38,10 @@ userdir-ldap (0.3.15+xxx) XXunstable; urgency=low debianServer schema and teach ud-host about it * ud-host: cleanup: Replace local copy HBaseDn of the centrally configured HostBaseDn. + * ud-generate: 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!")). [ Joerg Jaspert ] * Enhance copyright file a bit, also adding a pointer to our repository diff --git a/debian/install b/debian/install index 348510a..a3cca0f 100644 --- a/debian/install +++ b/debian/install @@ -21,5 +21,5 @@ ud-roleadd usr/bin sigcheck usr/bin userdir-ldap.conf etc/userdir-ldap/ generate.conf etc/userdir-ldap/ -templates/ etc/userdir-ldap/templates/ +templates/ etc/userdir-ldap/ userdir-ldap.schema etc/ldap/schema/ diff --git a/ud-generate b/ud-generate index feec2b1..8537f0c 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,PwdMarker,UidShift): +def GenPasswd(l,File,HomePrefix,PwdMarker): F = None; try: F = open(File + ".tdb.tmp","w"); @@ -116,7 +116,7 @@ def GenPasswd(l,File,HomePrefix,PwdMarker,UidShift): Line = Sanitize(Line) + "\n"; F.write("0%u %s" % (I,Line)); F.write(".%s %s" % (GetAttr(x,"uid"),Line)); - F.write("=%s %s" % ((int(GetAttr(x,"uidNumber"))+UidShift),Line)); + F.write("=%s %s" % (GetAttr(x,"uidNumber"),Line)); I = I + 1; # Oops, something unspeakable happened. @@ -209,7 +209,7 @@ def GenSSHShadow(l,File): Done(File,F,None); # Generate the group list -def GenGroup(l,File,UidShift): +def GenGroup(l,File): F = None; try: F = open(File + ".tdb.tmp","w"); @@ -242,10 +242,7 @@ def GenGroup(l,File,UidShift): for x in GroupMap.keys(): if GroupIDMap.has_key(x) == 0: continue; - NewGid = int(GroupIDMap[x]); - if NewGid >= 500: - NewGid = NewGid + UidShift - Line = "%s:x:%u:" % (x,NewGid) + Line = "%s:x:%u:" % (x,GroupIDMap[x]); Comma = ''; for I in GroupMap[x]: Line = Line + ("%s%s" % (Comma,I)); @@ -253,7 +250,7 @@ def GenGroup(l,File,UidShift): Line = Sanitize(Line) + "\n"; F.write("0%u %s" % (J,Line)); F.write(".%s %s" % (x,Line)); - F.write("=%u %s" % (NewGid,Line)); + F.write("=%u %s" % (GroupIDMap[x],Line)); J = J + 1; # Oops, something unspeakable happened. @@ -856,14 +853,12 @@ while(1): DoLink(GlobalDir,OutDir,"disabled-accounts") sys.stdout.flush(); - UidShift = 0 - if ExtraList.has_key("[UIDSHIFT]"): UidShift=1000 if ExtraList.has_key("[NOPASSWD]"): - GenPasswd(l,OutDir+"passwd",Split[1], "*", UidShift); + GenPasswd(l,OutDir+"passwd",Split[1], "*"); else: - GenPasswd(l,OutDir+"passwd",Split[1], "x", UidShift); + GenPasswd(l,OutDir+"passwd",Split[1], "x"); sys.stdout.flush(); - GenGroup(l,OutDir+"group", UidShift); + GenGroup(l,OutDir+"group"); if ExtraList.has_key("[UNTRUSTED]"): continue; if not ExtraList.has_key("[NOPASSWD]"): diff --git a/ud-replicate b/ud-replicate index 26818ed..0c17297 100755 --- a/ud-replicate +++ b/ud-replicate @@ -39,7 +39,7 @@ lockfile -r 1 -l 3600 lock trap "rm -f lock" exit case $HOST in -*$LOCALSYNCON*) +$LOCALSYNCON) udhost= ;; *) diff --git a/ud-userimport b/ud-userimport index 3e926ec..4e044c7 100755 --- a/ud-userimport +++ b/ud-userimport @@ -83,8 +83,10 @@ def DoPasswd(l,Passwd): Split = re.split("[:\n]",Line); (Split[4],cn,mn,sn) = ParseGecos(Split[4]); - Split[2] = int(Split[2]) - Split[3] = int(Split[3]) + # This just tests whether these are integers and throws an + # exception if not + int(Split[2]) + int(Split[3]) Rec = [("uid",Split[0]), ("uidNumber",Split[2]), ("gidNumber",Split[3]), @@ -106,8 +108,8 @@ def DoPasswd(l,Passwd): if (DoAdd == 1): try: - AddRec = Rec - Rec.append(("objectClass", UserObjectClasses)) + AddRec = Rec[:] + AddRec.append(("objectClass", UserObjectClasses)) l.add_s(Dn,AddRec) DoModify = False @@ -143,7 +145,7 @@ def DoShadow(l,Shadow): continue; for x in range(2,8): - Split[x] = int(Split[x]) + int(Split[x]) Rec = [(ldap.MOD_REPLACE,"shadowLastChange",Split[2]), (ldap.MOD_REPLACE,"shadowMin",Split[3]), @@ -184,7 +186,7 @@ def DoGroup(l,Group): # Split up the group information Split = re.split("[:\n]",Line); Members = re.split("[, ]*",Split[3]); - Split[2] = int(Split[2]) + int(Split[2]) # Iterate over the membership list and add the membership information # To the directory