[debian-edu-commits] debian-edu/upstream/ 22/71: Need to add shadow entry too, to avoid forced password change on first login.

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 15f4e7a6a3387821d200c9d5ed7b40c8eaaaf211
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Mon May 3 09:59:48 2010 +0000

    Need to add shadow entry too, to avoid forced password change on first login.
---
 debian/pam-python.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/debian/pam-python.py b/debian/pam-python.py
index d7d2c6e..81f6046 100755
--- a/debian/pam-python.py
+++ b/debian/pam-python.py
@@ -53,13 +53,20 @@ def check_and_create_localuser(pamh, user):
 #    print "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.
+      # XXX Should only add entry if is is missing in /etc/passwd
+
       # Can not use adduser, as it refuses to add an existing user.
       #cmd = "/usr/sbin/adduser --disabled-password --uid %d --gid %d --gecos '%s' --home %s %s" % \
       #    (uid, gid, gecos, newhomedir, user)
+
       cmd = "/bin/echo '%s:x:%d:%d:%s:%s:%s' >> /etc/passwd" \
             % (user, uid, gid, gecos, newhomedir, shell)
+      runcmd(pamh, cmd)
 
-      # XXX Should only add entry if is is missing in /etc/passwd
+      # Add shadow entry too.
+      # XXX Should only add it if it is missing
+      cmd = "/bin/echo '%s:x:%d:%d:%d:%d:::' >> /etc/shadow" \
+            % (user, 14730, 0, 99999, 7)
       runcmd(pamh, cmd)
 
       # Copy content of /etc/skel

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