Issue #7500 has been updated by Ben Hughes.

Status changed from Unreviewed to Investigating
Assignee set to Ben Hughes

Hi, thanks for the patch.

I've been trying to work out how to test/recreate this, as I can't reproduce 
the symptoms. I don't see how -p is getting in there.

Could you give me an example manifest that triggers this and what the actual 
and expected behaviour is please and I'll look in to it more.

Thanks.
----------------------------------------
Bug #7500: Don't let pw provider use -p
https://projects.puppetlabs.com/issues/7500

Author: Douglas Rand
Status: Investigating
Priority: Normal
Assignee: Ben Hughes
Category: FreeBSD
Target version: 
Affected Puppet version: 2.6.7
Keywords: freebsd pw password
Branch: 


The -p option to pw is documented as:

<pre>
-p date       Set the account's password expiration date.  This field is
              similar to the account expiration date option, except that
              it applies to forced password changes.  This is set in the
              same manner as the -e option.
</pre>

But provider/user/pw.rb takes the first character of each property as
the option to pw (through provider/nameservice/objectadd.rb I think).

The problem is that that sets the password as expiring now().

Here is a patch to ignore the password property, which is already
handled via cryptpw in pw.rb:

<pre>
--- pw.rb-orig  2011-05-12 16:47:24.000000000 -0500
+++ pw.rb       2011-05-12 16:47:16.000000000 -0500
@@ -24,7 +24,7 @@
   def addcmd
     cmd = [command(:pw), "useradd", @resource[:name]]
     @resource.class.validproperties.each do |property|
-      next if property == :ensure
+      next if property == :ensure or property == :password
       # the value needs to be quoted, mostly because -c might
       # have spaces in it
       if value = @resource.should(property) and value != ""
</pre>


-- 
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