diff options
author | Marlin Cremers <marlin@true.nl> | 2019-01-15 23:22:05 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-01-15 23:22:05 +0000 |
commit | ad170db966492e845b9dc23346cc7297e8a99032 (patch) | |
tree | 7b7990c8d64f981f1422f84fb0c9b918409d6a0a /cloudinit/config/cc_set_passwords.py | |
parent | fdadcb5fae51f4e6799314ab98e3aec56c79b17c (diff) | |
download | vyos-cloud-init-ad170db966492e845b9dc23346cc7297e8a99032.tar.gz vyos-cloud-init-ad170db966492e845b9dc23346cc7297e8a99032.zip |
cc_set_passwords: Fix regex when parsing hashed passwords
Correct invalid regex to match hashes starting with the following:
- $1, $2a, $2y, $5 or $6
LP: #1811446
Diffstat (limited to 'cloudinit/config/cc_set_passwords.py')
-rwxr-xr-x | cloudinit/config/cc_set_passwords.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/config/cc_set_passwords.py b/cloudinit/config/cc_set_passwords.py index 5ef97376..4585e4d3 100755 --- a/cloudinit/config/cc_set_passwords.py +++ b/cloudinit/config/cc_set_passwords.py @@ -160,7 +160,7 @@ def handle(_name, cfg, cloud, log, args): hashed_users = [] randlist = [] users = [] - prog = re.compile(r'\$[1,2a,2y,5,6](\$.+){2}') + prog = re.compile(r'\$(1|2a|2y|5|6)(\$.+){2}') for line in plist: u, p = line.split(':', 1) if prog.match(p) is not None and ":" not in p: |