chpasswd: is mangling certain password hashes

Bug #1811446 reported by Ryan Harper on 2019-01-11
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init
Undecided
Unassigned
cloud-init (Ubuntu)
Undecided
Unassigned

Bug Description

#cloud-config

# from 1 files
# part-001

---
chpasswd:
    expire: false
    list: 'root:$2y$10$8BQjxjVByHA/Ee.O1bCXtO8S7Y5WojbXWqnqYpUW.BrPx/Dlew1Va

        '

From #cloud-init

<marlinc_> Hey there, I'm not sure whether I'm running into a bug or not
<marlinc_> I'm trying to set the password hash for the root user on a system using the chpasswd module
<marlinc_> It should match new hash at this line in the module but it doens't seem to match
<marlinc_> https://github.com/cloud-init/cloud-init/blame/master/cloudinit/config/cc_set_passwords.py#L163
<marlinc_> I can confirm this when running it through https://regex101.com/r/Nj7VTZ/1
<marlinc_> Then I was thinking, isn't [] for lists of characters rather than lists of strings
<marlinc_> Changing it to \$(1|2a|2y|5|6)(\$.+){2} does work
<marlinc_> At least in regex101
<marlinc_> smoser, you any idea, I saw you commited the change: https://github.com/cloud-init/cloud-init/commit/21632972df034c200578e1fbc121a07f20bb8774
<smoser> marlinc_: i'd think yes. that is a bug for the '2a' and '2y'

Related branches

Marlin Cremers (marlinc) on 2019-01-11
description: updated
Chad Smith (chad.smith) on 2019-01-15
Changed in cloud-init (Ubuntu):
status: New → In Progress
Changed in cloud-init:
status: New → In Progress

This bug is fixed with commit ad170db9 to cloud-init on branch master.
To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=ad170db9

Changed in cloud-init:
status: In Progress → Fix Committed
Marlin Cremers (marlinc) on 2019-01-15
Changed in cloud-init (Ubuntu):
status: In Progress → Fix Committed
status: Fix Committed → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers