[debian-edu-commits] debian-edu/upstream/ 04/71: Look up group name and add more debug output.

Petter Reinholdtsen pere at moszumanska.debian.org
Mon Jun 9 18:25:35 UTC 2014


This is an automated email from the git hooks/post-receive script.

pere pushed a commit to branch master
in repository libpam-mklocaluser.

commit c512877583b8e2452036d773ce7827b26285877a
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Sat May 1 10:01:59 2010 +0000

    Look up group name and add more debug output.
---
 debian/pam-python.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/debian/pam-python.py b/debian/pam-python.py
index c0f2751..f28e537 100755
--- a/debian/pam-python.py
+++ b/debian/pam-python.py
@@ -8,6 +8,7 @@
 import os
 import sys
 import pwd
+import grp
 import subprocess
 
 def runcmd(pamh, cmd):
@@ -21,7 +22,8 @@ def check_and_create_localuser(pamh, user):
   gid = userinfo[3]
   gecos = userinfo[4]
 
-  # XXX Look up primary group name
+  groupinfo = grp.getgrgid(gid)
+  groupname = groupinfo[0]
 
   # Ignore users with uid < 1000
   if userinfo[2] < 1000:
@@ -34,7 +36,7 @@ def check_and_create_localuser(pamh, user):
 
   newhomedir = os.path.join("/home/",user)
   if not os.path.isdir(newhomedir):
-    print "Creating user %s" % (user)
+    print "Creating user %s with uid=%d gid=%d(%s) gecos='%s'" % (user, uid, gid, groupname, gecos)
     try:
       # Run addgroup
       cmd = ["addgroup", "--gid", gid, groupname]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/upstream/libpam-mklocaluser.git



More information about the debian-edu-commits mailing list