Issue #7442 has been updated by Ben Hughes.

Status changed from Unreviewed to Accepted

Thank you Gary for doing all the leg work. That is what we need to do.

>From the Sunny Solaris man pages:

<pre>
     -n min              Sets minimum field  for  name.  The  min
                         field  contains  the  minimum  number of
                         days between password changes for  name.
                         If min is greater than max, the user can
                         not change the password. Always use this
                         option with the -x option, unless max is
                         set to -1 (aging turned  off).  In  that
                         case, min need not be set.
[...]
     -x max              Sets maximum field  for  name.  The  max
                         field  contains  the number of days that
                         the password  is  valid  for  name.  The
                         aging for name is turned off immediately
                         if max is set to -1.
</pre>

Trying on a real bonafide Solaris machine:

<pre>
[root@slave10:~]# /usr/bin/passwd -n -1 ben          
passwd: Invalid argument to option -n
Invalid argument to option
[root@slave10:~]# /usr/bin/passwd -x -1 ben
passwd: password information changed for ben
[root@slave10:~]# /usr/bin/passwd -x -1 -n -1 ben
passwd: Invalid argument to option -n
Invalid argument to option
</pre>

In the case of maximum_age being -1, we should ignore minimum_age it seems.
----------------------------------------
Bug #7442: User provided password age bug on Solaris with 2.7.0.rc2
https://projects.puppetlabs.com/issues/7442

Author: Gary Law
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


Hi

Applying the following:-

<pre>
user { 'puppet':
  ensure           => 'present',
  comment          => 'Puppet',
  gid              => '52',
  home             => '/var/lib/puppet',
  password         => '!!',
  password_max_age => '-1',
  password_min_age => '-1',
  shell            => '/bin/true',
  uid              => '52',
}
</pre>

(known good on Darwin and CentOS) fails on Solaris:

<pre>
$ sudo puppet apply /etc/puppet/manifests/site.pp 
glaw@sv01:~ $ sudo puppet apply /etc/puppet/manifests/site.pp 
prtconf: devinfo facility not available
err: /Stage[main]/Puppet/User[puppet]/password_min_age: change from  to -1 
failed: Could not set password_min_age on user[puppet]: Execution of 
'/usr/bin/passwd -n -1 puppet' returned 6: passwd: Invalid argument to option -n
Invalid argument to option

notice: /Stage[main]/Puppet/User[puppet]/password_max_age: password_max_age 
changed '' to '-1'
notice: Class[Puppet]: Dependency User[puppet] has failures: true
warning: Class[Puppet]: Skipping because of failed dependencies
notice: Stage[main]: Dependency User[puppet] has failures: true
warning: Stage[main]: Skipping because of failed dependencies
notice: Finished catalog run in 0.13 seconds
glaw@sv01:~ $ 
</pre>

I *think* that the correct command for passwd in this case would be
/usr/bin/passwd -x -1 puppet

But in any event the provider doesn't seem to report on it, so even setting 
this correctly by hand doesn't cause puppet to apply the config without error:

<pre>
$ sudo puppet resource user puppet
prtconf: devinfo facility not available
user { 'puppet':
  ensure   => 'present',
  comment  => 'Puppet',
  gid      => '52',
  home     => '/var/lib/puppet',
  password => '!!',
  shell    => '/bin/true',
  uid      => '52',
}
</pre>

Gary



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to