[debian-edu-commits] debian-edu/upstream/ 01/04: Make sure to add trailing newline when updating /etc/passwd and /etc/shadow.

Petter Reinholdtsen pere at moszumanska.debian.org
Thu Aug 14 12:41:33 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 c316b16a14f8a8ac3398c94ad63251701b86d8d1
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Thu Aug 14 14:33:51 2014 +0200

    Make sure to add trailing newline when updating /etc/passwd and /etc/shadow.
---
 debian/changelog     | 7 +++++++
 debian/pam-python.py | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1ede414..7ce96c5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libpam-mklocaluser (0.10) UNRELEASED; urgency=low
+
+  * Make sure to add trailing newline when updating /etc/passwd and
+    /etc/shadow.
+
+ -- Petter Reinholdtsen <pere at debian.org>  Thu, 14 Aug 2014 14:32:54 +0200
+
 libpam-mklocaluser (0.9) unstable; urgency=low
 
   * Update standard-version from 3.9.2 to 3.9.5.  No changes needed.
diff --git a/debian/pam-python.py b/debian/pam-python.py
index 0a79c1c..30487ef 100755
--- a/debian/pam-python.py
+++ b/debian/pam-python.py
@@ -100,13 +100,13 @@ def check_and_create_localuser(pamh, user):
       # Can not use adduser, as it refuses to add a user if it already
       # is visible via NSS.
       append_line('/etc/passwd', \
-                    '%s:x:%d:%d:%s:%s:%s' % \
+                    "%s:x:%d:%d:%s:%s:%s\n" % \
                     (user, uid, gid, gecos, newhomedir, shell))
 
       # Add shadow entry too.
       # FIXME Should only add it if it is missing.  
       append_line('/etc/shadow', \
-                    '%s:x:%d:%d:%d:%d:::' \
+                    "%s:x:%d:%d:%d:%d:::\n" \
                     % (user, pwlastchange, pwminage, pwmaxage, pwwarn))
 
       syslog.syslog("Creating local home directory for user '%s'" % 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