diff options
author | Hugues Hiegel <root@paranoid> | 2015-04-21 12:45:58 +0200 |
---|---|---|
committer | Hugues Hiegel <root@paranoid> | 2015-04-21 12:45:58 +0200 |
commit | ef2e7b3f9d264ec146d4dae257b1e295ab3b462a (patch) | |
tree | 76b4a98d7b3b38f691c4fbee1612197ab6615c2b /plugins/password/helpers/chpass-wrapper.py | |
parent | d09b64c6270c638059b003922db508f95d32d555 (diff) |
updates - plugins as a separate git folder
Diffstat (limited to 'plugins/password/helpers/chpass-wrapper.py')
-rw-r--r-- | plugins/password/helpers/chpass-wrapper.py | 32 |
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) |