[debian-edu-commits] debian-edu/upstream/ 05/71: 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 6826f021e9a8644d2465702e13d7afb93f2fd8d6
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Sat May 1 10:10:52 2010 +0000

    More debug output.
---
 debian/pam-python.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/debian/pam-python.py b/debian/pam-python.py
index f28e537..c2243cd 100755
--- a/debian/pam-python.py
+++ b/debian/pam-python.py
@@ -17,10 +17,15 @@ def runcmd(pamh, cmd):
   print "output: %s" % output
 
 def check_and_create_localuser(pamh, user):
+  # Location of local users
+  topdir = "/home"
+
+  # Fetch current user and group info, possibly from LDAP or NIS.
   userinfo = pwd.getpwnam(user)
   uid = userinfo[2]
   gid = userinfo[3]
   gecos = userinfo[4]
+  homedir =  userinfo[5]
 
   groupinfo = grp.getgrgid(gid)
   groupname = groupinfo[0]
@@ -29,19 +34,22 @@ def check_and_create_localuser(pamh, user):
   if userinfo[2] < 1000:
     return pamh.PAM_SUCCESS
 
-  homedir =  userinfo[5]
   if None == homedir:
     print "Home directory is not set for user %s" % user
     return pamh.PAM_USER_UNKNOWN
 
-  newhomedir = os.path.join("/home/",user)
+  newhomedir = os.path.join(topdir, user)
   if not os.path.isdir(newhomedir):
-    print "Creating user %s with uid=%d gid=%d(%s) gecos='%s'" % (user, uid, gid, groupname, gecos)
+    print "Creating user %s with uid=%d gid=%d(%s) gecos='%s' homedir=%s" % (user, uid, gid, groupname, gecos, newhomedir)
     try:
       # Run addgroup
       cmd = ["addgroup", "--gid", gid, groupname]
       runcmd(pamh, cmd)
+    except Exception, e:
+      print e
+      pass
 
+    try:
       # Run adduser 
       cmd = ["adduser",
              "--disabled-password",

-- 
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