aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/puppet/files
diff options
context:
space:
mode:
authorswills <swills@FreeBSD.org>2011-11-13 21:18:28 +0800
committerswills <swills@FreeBSD.org>2011-11-13 21:18:28 +0800
commita3b16b850498346600608ccc7202b5e835c5c2e5 (patch)
tree510501f13cfdae332f6084ade63a9798c5aedc03 /sysutils/puppet/files
parent0b69b3c2d820270129a9dd0177cfab1e9079d9d8 (diff)
downloadfreebsd-ports-gnome-a3b16b850498346600608ccc7202b5e835c5c2e5.tar.gz
freebsd-ports-gnome-a3b16b850498346600608ccc7202b5e835c5c2e5.tar.zst
freebsd-ports-gnome-a3b16b850498346600608ccc7202b5e835c5c2e5.zip
Use more correct version of the password provider fix
Submitted by: tdb (private email) Feature safe: yes
Diffstat (limited to 'sysutils/puppet/files')
-rw-r--r--sysutils/puppet/files/patch-fix_password_provider21
1 files changed, 17 insertions, 4 deletions
diff --git a/sysutils/puppet/files/patch-fix_password_provider b/sysutils/puppet/files/patch-fix_password_provider
index 8fd0e20fac78..8758296d017b 100644
--- a/sysutils/puppet/files/patch-fix_password_provider
+++ b/sysutils/puppet/files/patch-fix_password_provider
@@ -1,5 +1,3 @@
-diff --git lib/puppet/provider/user/pw.rb lib/puppet/provider/user/pw.rb
-index a5988ca..c2fff37 100644
--- lib/puppet/provider/user/pw.rb
+++ lib/puppet/provider/user/pw.rb
@@ -1,10 +1,11 @@
@@ -15,11 +13,27 @@ index a5988ca..c2fff37 100644
defaultfor :operatingsystem => :freebsd
-@@ -37,5 +38,24 @@ Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService::
+@@ -23,7 +24,7 @@ Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService::
+ 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 != ""
+@@ -37,5 +38,30 @@ Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService::
cmd
end
+
++ def create
++ super
++
++ # Set the password after create if given
++ self.password = @resource[:password] if @resource[:password]
++ end
++
+ # use pw to update password hash
+ def password=(cryptopw)
+ Puppet.debug "change password for user '#{@resource[:name]}' method called with hash '#{cryptopw}'"
@@ -37,6 +51,5 @@ index a5988ca..c2fff37 100644
+ Puppet.debug "finished password for user '#{@resource[:name]}' method called : '#{current_password}'"
+ current_password
+ end
-+
end