diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-03-07 11:19:06 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-03-07 11:19:06 +0000 |
| commit | a7c3c8dc14e19dcf6fb56495b3c09bc41a66acf9 (patch) | |
| tree | 0c9ee87dff342e005102e00f497c5d88bf844e01 /plugins/password/drivers/chpass-wrapper.py | |
| parent | fe3e81a373f8018745d4473f0690ac9a7f015bb3 (diff) | |
- Helper files moved to helpers/ directory from drivers/
git-svn-id: https://svn.roundcube.net/trunk@5977 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/password/drivers/chpass-wrapper.py')
| -rw-r--r-- | plugins/password/drivers/chpass-wrapper.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/plugins/password/drivers/chpass-wrapper.py b/plugins/password/drivers/chpass-wrapper.py deleted file mode 100644 index 61bba849e..000000000 --- a/plugins/password/drivers/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) |
