[debian-edu-commits] debian-edu/upstream/ 06/71: Try different approach to get Popen() working.

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 6e8b17cb42e8601d2aa25624f096ac2959f992b8
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Sat May 1 11:23:18 2010 +0000

    Try different approach to get Popen() working.
---
 debian/pam-python.py | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/debian/pam-python.py b/debian/pam-python.py
index c2243cd..46a7b93 100755
--- a/debian/pam-python.py
+++ b/debian/pam-python.py
@@ -12,7 +12,7 @@ import grp
 import subprocess
 
 def runcmd(pamh, cmd):
-  proc = subprocess.Popen(cmd, shell=True,  stdout=subprocess.PIPE,)
+  proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,)
   output = proc.communicate()[0]
   print "output: %s" % output
 
@@ -40,10 +40,10 @@ def check_and_create_localuser(pamh, 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' homedir=%s" % (user, uid, gid, groupname, gecos, newhomedir)
+    print "Creating user %s with uid=%d gid=%d(%s) gecos='%s' home=%s" % (user, uid, gid, groupname, gecos, newhomedir)
     try:
       # Run addgroup
-      cmd = ["addgroup", "--gid", gid, groupname]
+      cmd = "/usr/sbin/addgroup --gid %d %s" % (gid, groupname)
       runcmd(pamh, cmd)
     except Exception, e:
       print e
@@ -51,11 +51,8 @@ def check_and_create_localuser(pamh, user):
 
     try:
       # Run adduser 
-      cmd = ["adduser",
-             "--disabled-password",
-             "--uid", uid, "--gid", gid, "--gecos", gecos,
-             "--homedir", newhomedir,
-             user]
+      cmd = "/usr/sbin/adduser --disabled-password --uid %d --gid %d --gecos '%s' --home %s %s" % \
+          (uid, gid, gecos, newhomedir, user)
       runcmd(pamh, cmd)
     except Exception, e:
       print e

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