[debian-edu-commits] debian-edu/upstream/ 16/71: Some cleanup.

Petter Reinholdtsen pere at moszumanska.debian.org
Mon Jun 9 18:25:36 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 09cd15f0994a517091a4e71844459782c5d47ead
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Sat May 1 15:57:56 2010 +0000

    Some cleanup.
---
 debian/pam-python.py | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/debian/pam-python.py b/debian/pam-python.py
index 9d4d574..6ef9832 100755
--- a/debian/pam-python.py
+++ b/debian/pam-python.py
@@ -42,15 +42,6 @@ def check_and_create_localuser(pamh, user):
   newhomedir = os.path.join(topdir, user)
   if not os.path.isdir(newhomedir):
     print "Creating local passwd entry uid=%d (%s) gid=%d(%s) gecos='%s' home=%s" % (uid, user, gid, groupname, gecos, newhomedir)
-#    try:
-#      # Add primary group to /etc/group
-#      #cmd = "/usr/sbin/addgroup --gid %d %s" % (gid, groupname)
-#      cmd = "/bin/echo '%s:x:%d:' >> /etc/group" % (groupname, gid)
-#      runcmd(pamh, cmd)
-#    except Exception, e:
-#      print e
-#      pass
-
     try:
       # Add user entry with overridden home directory in /etc/passwd.
       # Can not use adduser, as it refuses to add an existing user.
@@ -59,6 +50,8 @@ def check_and_create_localuser(pamh, user):
       shell = '/bin/bash'
       cmd = "/bin/echo '%s:x:%d:%d:%s:%s:%s' >> /etc/passwd" \
             % (user, uid, gid, gecos, newhomedir, shell)
+
+      # XXX Should only add entry if is is missing in /etc/passwd
       runcmd(pamh, cmd)
 
       # Copy content of /etc/skel
@@ -67,7 +60,7 @@ def check_and_create_localuser(pamh, user):
       # Change perm of new home dir
       os.chmod(newhomedir,0700)
       # os.chown(newhomedir, uid, gid)
-      runcmd(pamh, "/bin/chown -R %d:%d %s" % (uid, gid, newhomedir))
+      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")
@@ -128,6 +121,7 @@ if __name__ == '__main__':
     PAM_SUCCESS = 1
     PAM_USER_UNKNOWN = 2
     PAM_SYSTEM_ERR = 3
+    PAM_TRY_AGAIN = 4
   pamh = pam_handler()
   user = sys.argv[1]
   check_and_create_localuser(pamh, user)

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