From dc678dd51073defe1aed8deadaf621cadfa1d819 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Wed, 29 May 2019 19:19:25 -0400 Subject: [PATCH] include punctuation in random passwords --- src/gam.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gam.py b/src/gam.py index f8e86aa0..1f1b8179 100755 --- a/src/gam.py +++ b/src/gam.py @@ -7497,7 +7497,8 @@ def getUserAttributes(i, cd, updateCmd): systemErrorExit(2, '%s is not a valid argument for "gam %s user"' % (sys.argv[i], ['create', 'update'][updateCmd])) if need_password: rnd = SystemRandom() - body['password'] = ''.join(rnd.choice(string.digits+string.ascii_letters) for _ in range(100)) + valid_chars = string.digits+string.ascii_letters+string.punctuation + body['password'] = ''.join(rnd.choice(valid_chars) for _ in range(100)) if 'password' in body and need_to_hash_password: body['password'] = gen_sha512_hash(body['password']) body['hashFunction'] = 'crypt'