View | Details | Raw Unified | Return to bug 164634
Collapse All | Expand All

(-)Makefile (-3 / +1 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	puppet
8
PORTNAME=	puppet
9
PORTVERSION=	2.7.9
9
PORTVERSION=	2.7.10
10
CATEGORIES=	sysutils
10
CATEGORIES=	sysutils
11
MASTER_SITES=	http://downloads.puppetlabs.com/puppet/
11
MASTER_SITES=	http://downloads.puppetlabs.com/puppet/
12
12
Lines 16-23 Link Here
16
RUN_DEPENDS=	facter>=0:${PORTSDIR}/sysutils/facter \
16
RUN_DEPENDS=	facter>=0:${PORTSDIR}/sysutils/facter \
17
		rubygem-ruby-augeas>=0:${PORTSDIR}/textproc/rubygem-augeas
17
		rubygem-ruby-augeas>=0:${PORTSDIR}/textproc/rubygem-augeas
18
18
19
CONFLICTS=	puppet-devel-[0-9]*
20
21
NO_BUILD=	yes
19
NO_BUILD=	yes
22
USE_RUBY=	yes
20
USE_RUBY=	yes
23
USE_RUBY_FEATURES=	iconv
21
USE_RUBY_FEATURES=	iconv
(-)distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (puppet-2.7.9.tar.gz) = b15a2031e39c8eb8768efcc2d24030258abc9e33efd9c5212ab0fd9b983e2b94
1
SHA256 (puppet-2.7.10.tar.gz) = 0d0452ed2a22acb60f9fd4ebaeb6d04bb73ab5299f59003bf7b53d6391dc1127
2
SIZE (puppet-2.7.9.tar.gz) = 1778208
2
SIZE (puppet-2.7.10.tar.gz) = 1843484
(-)files/patch-fix_password_provider (-55 lines)
Removed Link Here
1
--- lib/puppet/provider/user/pw.rb
2
+++ lib/puppet/provider/user/pw.rb
3
@@ -1,10 +1,11 @@
4
 require 'puppet/provider/nameservice/pw'
5
+require 'open3'
6
 
7
 Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService::PW do
8
   desc "User management via `pw` on FreeBSD."
9
 
10
   commands :pw => "pw"
11
-  has_features :manages_homedir, :allows_duplicates
12
+  has_features :manages_homedir, :allows_duplicates, :manages_passwords
13
 
14
   defaultfor :operatingsystem => :freebsd
15
 
16
@@ -23,7 +24,7 @@ Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService::
17
   def addcmd
18
     cmd = [command(:pw), "useradd", @resource[:name]]
19
     @resource.class.validproperties.each do |property|
20
-      next if property == :ensure
21
+      next if property == :ensure or property == :password
22
       # the value needs to be quoted, mostly because -c might
23
       # have spaces in it
24
       if value = @resource.should(property) and value != ""
25
@@ -37,5 +38,30 @@ Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService::
26
 
27
     cmd
28
   end
29
+
30
+  def create
31
+    super
32
+
33
+    # Set the password after create if given
34
+    self.password = @resource[:password] if @resource[:password]
35
+  end
36
+
37
+  # use pw to update password hash
38
+  def password=(cryptopw)
39
+    Puppet.debug "change password for user '#{@resource[:name]}' method called with hash '#{cryptopw}'"
40
+    stdin, stdout, stderr = Open3.popen3("pw user mod #{@resource[:name]} -H 0")
41
+    stdin.puts(cryptopw)
42
+    stdin.close
43
+    Puppet.debug "finished password for user '#{@resource[:name]}' method called with hash '#{cryptopw}'"
44
+  end
45
+
46
+  # get password from /etc/master.passwd
47
+  def password
48
+    Puppet.debug "checking password for user '#{@resource[:name]}' method called"
49
+    current_passline = `getent passwd #{@resource[:name]}`
50
+    current_password = current_passline.chomp.split(':')[1] if current_passline
51
+    Puppet.debug "finished password for user '#{@resource[:name]}' method called : '#{current_password}'"
52
+    current_password
53
+  end
54
 end
55
 

Return to bug 164634