[debian-edu-commits] debian-edu/upstream/ 44/71: * Do not add localuser if it already exist in /etc/passwd. * Add build-dependency on python-support. * Make sure that dh_pysupport is run during build. * Added myself as uploader.

Petter Reinholdtsen pere at moszumanska.debian.org
Mon Jun 9 18:25:38 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 9c710bd357eaeb228e71eee67b18bc4fff787f2a
Author: Morten Werner Olsen <werner at debian.org>
Date:   Tue Jun 1 12:08:13 2010 +0000

     * Do not add localuser if it already exist in /etc/passwd.
     * Add build-dependency on python-support.
     * Make sure that dh_pysupport is run during build.
     * Added myself as uploader.
---
 debian/changelog     | 9 +++++++++
 debian/control       | 4 ++--
 debian/pam-python.py | 8 +++++++-
 debian/rules         | 2 +-
 4 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b9632bb..69a71cd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+libpam-mklocaluser (0.4) UNRELEASED; urgency=low
+
+  * Do not add localuser if it already exist in /etc/passwd.
+  * Add build-dependency on python-support.
+  * Make sure that dh_pysupport is run during build.
+  * Added myself as uploader.
+
+ -- Morten Werner Forsbring <werner at debian.org>  Tue, 01 Jun 2010 13:20:41 +0200
+
 libpam-mklocaluser (0.3) unstable; urgency=low
 
   * Make sure the path to the original home directory and the user
diff --git a/debian/control b/debian/control
index 427b750..63d0cbb 100644
--- a/debian/control
+++ b/debian/control
@@ -2,8 +2,8 @@ Source: libpam-mklocaluser
 Section: misc
 Priority: optional
 Maintainer: Debian Edu Developers <debian-edu at lists.debian.org>
-Uploaders: Petter Reinholdtsen <pere at debian.org>
-Build-Depends: debhelper (>= 7)
+Uploaders: Petter Reinholdtsen <pere at debian.org>, Morten Werner Forsbring <werner at debian.org>
+Build-Depends: debhelper (>= 7), python-support
 Standards-Version: 3.8.4
 Homepage: http://www.skolelinux.org/
 Vcs-Browser: http://svn.debian.org/wsvn/debian-edu/trunk/src/libpam-mklocaluser/?rev=0&sc=0
diff --git a/debian/pam-python.py b/debian/pam-python.py
index 284d9f1..563694b 100755
--- a/debian/pam-python.py
+++ b/debian/pam-python.py
@@ -54,6 +54,13 @@ def check_and_create_localuser(pamh, user):
   if userinfo[2] < minimum_uid:
     return pamh.PAM_SUCCESS
 
+  # Ignore users with existing entry in /etc/passwd
+  cmd = "/bin/grep \"^%s:\" /etc/passwd >/dev/null" % user
+  proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,)
+  result = proc.communicate()
+  if proc.returncode == 0:
+    return pamh.PAM_SUCCESS
+
   if None == homedir:
     syslog.syslog("Home directory is not set for user %s" % user)
     return pamh.PAM_USER_UNKNOWN
@@ -63,7 +70,6 @@ def check_and_create_localuser(pamh, user):
     syslog.syslog("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 a user if it already
       # is visible via NSS.
diff --git a/debian/rules b/debian/rules
index cbe925d..63c9ac0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,3 +1,3 @@
 #!/usr/bin/make -f
 %:
-	dh $@
+	dh --with python_support $@

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