summaryrefslogtreecommitdiff
path: root/plugins/password/helpers/chpass-wrapper.py
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2012-03-31 12:25:48 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2012-03-31 12:25:48 +0000
commite6d8f97bf2e0bbb4d95df0c4e030eb7ec6ef75a5 (patch)
tree4f6fdadb51cbe1a2bb3b2b06c9bcabb0429d1a84 /plugins/password/helpers/chpass-wrapper.py
parent868c169e2a64c1d19a9b6bbcd98f268808dfd173 (diff)
Move plugins repository into roundcubemail root folder; svn:externals are not defined anymore
git-svn-id: https://svn.roundcube.net/trunk@6034 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/password/helpers/chpass-wrapper.py')
-rw-r--r--plugins/password/helpers/chpass-wrapper.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/plugins/password/helpers/chpass-wrapper.py b/plugins/password/helpers/chpass-wrapper.py
deleted file mode 100644
index 61bba849e..000000000
--- a/plugins/password/helpers/chpass-wrapper.py
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import pwd
-import subprocess
-
-BLACKLIST = (
- # add blacklisted users here
- #'user1',
-)
-
-try:
- username, password = sys.stdin.readline().split(':', 1)
-except ValueError, e:
- sys.exit('Malformed input')
-
-try:
- user = pwd.getpwnam(username)
-except KeyError, e:
- sys.exit('No such user: %s' % username)
-
-if user.pw_uid < 1000:
- sys.exit('Changing the password for user id < 1000 is forbidden')
-
-if username in BLACKLIST:
- sys.exit('Changing password for user %s is forbidden (user blacklisted)' %
- username)
-
-handle = subprocess.Popen('/usr/sbin/chpasswd', stdin = subprocess.PIPE)
-handle.communicate('%s:%s' % (username, password))
-
-sys.exit(handle.returncode)