[Da-tools-commits] ./da-tools/userdir-ldap-common r377: Back out UIDShift patch, which wasn't correct anyway and shouldn't be merged

Marc 'HE' Brockschmidt he at debian.org
Thu Jan 10 14:17:11 UTC 2008


------------------------------------------------------------
revno: 377
committer: Marc 'HE' Brockschmidt <he at debian.org>
branch nick: userdir-ldap-common
timestamp: Thu 2008-01-10 15:17:11 +0100
message:
  Back out UIDShift patch, which wasn't correct anyway and shouldn't be merged
  to -common (yet)
modified:
  ud-generate
-------------- next part --------------
=== modified file 'ud-generate'
--- a/ud-generate	2007-12-27 08:39:32 +0000
+++ b/ud-generate	2008-01-10 14:17:11 +0000
@@ -88,7 +88,7 @@
     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 @@
       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 @@
   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 @@
    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 @@
       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 @@
    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]"):



More information about the Da-tools-commits mailing list