[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#597862: unblock: libpam-mklocaluser/0.6



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
x-debbugs-cc: debian-edu@lists.debian.org

Hi,

please unblock libpam-mklocaluser/0.6 which fixes two rather important bugs.

diff -Nur tags/0.5/ tags/0.6/|diffstat
 debian/changelog                             |   12 ++++++++++
 debian/control                               |    2 -
 debian/pam-python.py                         |   13 ++++++++---

libpam-mklocaluser (0.6) unstable; urgency=low 
   * Make module more robust.  Move group lookup into the code path
     where it is used, to avoid failing if the group is missing when
     the user is already available locally (Closes: #597174).
   * Add code to handle missing primary group information when creating
     the local user.
   * Change module to only run /usr/sbin/nscd if it exist (Closes: #597241).
   * Update standards-version from 3.8.4 to 3.9.1.  No changes needed.

 -- Petter Reinholdtsen <pere@debian.org>  Sat, 18 Sep 2010 16:55:27 +0200

--- 0.5/debian/pam-python.py    2010-09-23 18:42:57.000000000 +0200
+++ 0.6/debian/pam-python.py    2010-09-23 18:42:57.000000000 +0200
@@ -47,9 +47,6 @@
   gecos = userinfo[4]
   homedir =  userinfo[5]
 
-  groupinfo = grp.getgrgid(gid)
-  groupname = groupinfo[0]
-
   # Ignore users with uid < 1000
   if userinfo[2] < minimum_uid:
     return pamh.PAM_SUCCESS
@@ -67,6 +64,13 @@
 
   newhomedir = os.path.join(topdir, user)
   if not os.path.isdir(homedir) and not os.path.isdir(newhomedir):
+    try:
+      groupinfo = grp.getgrgid(gid)
+      groupname = groupinfo[0]
+    except KeyError, e:
+      syslog.syslog("Unknown primary group with gid %d" % gid)
+      groupname = "[unknown]"
+
     syslog.syslog("Creating local passwd entry uid=%d(%s) gid=%d(%s) 
gecos='%s' home=%s" % (uid, user, gid, groupname, gecos, newhomedir))
     try:
       # Add user entry with overridden home directory in /etc/passwd.
@@ -93,7 +97,8 @@
       runcmd(pamh, "/bin/chown -R %d:%d '%s'" % (uid, gid, newhomedir))
 
       # Flush nscd cache to get rid of original user entry
-      runcmd(pamh, "/usr/sbin/nscd -i passwd")
+      if os.access("/usr/sbin/nscd", os.X_OK):
+        runcmd(pamh, "/usr/sbin/nscd -i passwd")
 
       # Hook for adjusting the freshly created home directory
       # XXX Should be rewritten in python, I guess


Thanks,
	Holger

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: