Puppet: System Administration Automated

Support

Ticket #1186 (closed defect: invalid)

Opened 4 months ago

Last modified 4 months ago

if not using shadowed passwords then password will be set on every run

Reported by: micah Assigned to: community
Priority: normal Milestone:
Component: library Version: 0.24.4
Severity: normal Keywords: password shadow User
Cc: Triage Stage: Unreviewed
Attached Patches: None Complexity: Unknown

Description

I have a node that sets the password for users on every run, and thus I see this:

Apr 10 08:48:35 secondary puppetd[17418]: (//Node[secondary]/Account[jessie]/User[jessie]/password) defined 'password' as
'$1$xxxxxxxxxxxxxxxxxxxxxxxx'
Apr 10 08:48:35 secondary usermod[18097]: change user `jessie' password

(password was replaced by xxxxxxxx}

I've got a component setup to manage users, it looks like this:

define account ( $homeroot="/home", $shell="/bin/bash", $uid, $gid, $ingroups = [ "adm", "users", "dialout" ], $password, $fullname=$name, $ensure=present )
{

  group { $name:
    name => $name,
    gid => $gid,
    ensure => present,
    allowdupe => false
  }

  user { $name:
    uid => $uid,
    gid => $name,
    comment => $name,
    home => "${homeroot}/$name",
    shell => $shell,
    ensure => $ensure,
    groups => $ingroups,
    password => $password,
    allowdupe => false,
    require => Group[$name]
  }

  file { "${homeroot}/$name":
    ensure => directory,
    owner => $name, group => $name, mode => 750,
    require => User[$name]
   }

Then I am doing the following:

account {
        "jessie": uid => 1005, gid => 1011, password => '$1$xxxxxxxxxxxxxxxxxxxxxxxx';
      }

This behavior is only witnessed on those machines that do not have shadowed passwords enabled. This is an optional setting in Debian, and can be changed by running:

# dpkg-reconfigure passwd

and then answering yes/no to the question about enabling shadowed passwords.

I want shadowed passwords enabled, so the fact that this happened made me find out that they were not enabled on these machines and I've changed them and now I don't get the password being set on every run as before. However it seems possible that others may want shadow passwords disabled and may run into this problem, so I figured it was best to report it for those wondering what is going on.

Change History

04/10/08 22:33:39 changed by luke

  • status changed from new to closed.
  • resolution set to invalid.

This has to be a problem with the Etc library (and thus the posix libs) producing inconsistent results when shadowing isn't enabled. That means it's not something I can fix without a redesign (i.e., parsing /etc/shadow directly myself).

Thanks for pointing this out, though; at least it's recorded.