Password always locked?

Bug #1096423 reported by Joshua Harlow
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Joshua Harlow

Bug Description

The password seems to be always locked for a given user unless system: false is provided.

This seems to be due to the following logic.

if ('lock_passwd' not in kwargs and
            ('lock_passwd' in kwargs and kwargs['lock_passwd']) or 'system' not in kwargs):

Given a user config:

 - name: foobar
    gecos: Foo B. Bar
    primary-group: foobar
    groups: users
    selinux-user: staff_u
    expiredate: 2012-09-01
    ssh-import-id: foobar
    lock-passwd: false
    passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/

Even though lock-passwd is false, the password will be locked due to system not being in kwargs (no system field there) due to the final "or" here.

It should probably be this logic instead.

if (kwargs.get('lock_passwd', True) or kwargs.get('system', False)):

Which means if lock_passwd is False (on non-existent its true) then lock or if system is True (on non-existent its false) then lock.

Related branches

Revision history for this message
Scott Moser (smoser) wrote :

Fixed in revno 756.

See comment at . I basically just dropped relevance of 'system'. with reguard to changing the password.

Changed in cloud-init:
status: New → Fix Committed
assignee: nobody → Joshua Harlow (harlowja)
importance: Undecided → Low
Revision history for this message
Scott Moser (smoser) wrote :

fixed in 0.7.2

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.