summaryrefslogtreecommitdiff
path: root/ldap-sasl.py
diff options
context:
space:
mode:
Diffstat (limited to 'ldap-sasl.py')
-rw-r--r--ldap-sasl.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/ldap-sasl.py b/ldap-sasl.py
index 031eb88..86f53b7 100644
--- a/ldap-sasl.py
+++ b/ldap-sasl.py
@@ -20,7 +20,6 @@ class Config(object):
self.use_tls = not args.no_tls
self.dry_run = args.dry_run
self.verbose = args.verbose
- self.force = args.force
def _set_attr(self, name, args, config, default=None):
value = default
@@ -45,7 +44,6 @@ def cli():
parser.add_argument('--no-tls', action='store_true', default=False, help='Disable tls connection, dont use this outside local machine testing')
parser.add_argument('--dry-run', action='store_true', default=False, help='Dont change anything')
parser.add_argument('--verbose', '-v', action='store_true', default=False, help='Print extra info')
- parser.add_argument('--force', '-f', action='store_true', default=False, help='Dont stop on empty user password or missing rights')
return parser.parse_args()
@@ -61,7 +59,7 @@ def main():
conn.search('ou=people,dc=nordu,dc=net', '(uid=*)', attributes=['uid', 'userPassword'])
for user in conn.entries:
- if not user.userPassword.value or not user.userPassword.value[:6] in ('{SASL}', b'{SASL}') :
+ if not user.userPassword.value or not user.userPassword.value[:6] in ('{SASL}', b'{SASL}'):
print('[BAD]', user.uid, 'does not use SASL')
if not config.dry_run:
sasl_str = '{SASL}%s@NORDU.NET' % user.uid.value
@@ -69,7 +67,7 @@ def main():
print('[ERR]', 'Could not update password for', user.uid, 'got error:', conn.result['description'])
else:
if config.dry_run or config.verbose:
- print('[OK]', user.uid, user.entry_dn)
+ print('[OK]', user.uid)
conn.unbind()