← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1096423] Re: Password always locked?

 

fixed in 0.7.2

** Changed in: cloud-init
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1096423

Title:
  Password always locked?

Status in Init scripts for use on cloud images:
  Fix Released

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1096423/+subscriptions