components/ruby/puppet/patches/puppet-09-PUP-6796-role-shell.patch
changeset 7565 48aa82a0931f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ruby/puppet/patches/puppet-09-PUP-6796-role-shell.patch	Mon Nov 28 16:54:02 2016 -0800
@@ -0,0 +1,39 @@
+Merged with upstream PUP 4.9.0
+(PUP-6796) Support setting/checking shell in user_role_add
+https://tickets.puppetlabs.com/browse/PUP-6796
+
+diff --git a/lib/puppet/provider/user/user_role_add.rb b/lib/puppet/provider/user/user_role_add.rb
+--- a/lib/puppet/provider/user/user_role_add.rb
++++ b/lib/puppet/provider/user/user_role_add.rb
+@@ -12,6 +12,7 @@ Puppet::Type.type(:user).provide :user_role_add, :parent => :useradd, :source =>
+   options :home, :flag => "-d", :method => :dir
+   options :comment, :method => :gecos
+   options :groups, :flag => "-G"
++  options :shell, :flag => "-s"
+   options :roles, :flag => "-R"
+   options :auths, :flag => "-A"
+   options :profiles, :flag => "-P"
+@@ -26,8 +27,23 @@ Puppet::Type.type(:user).provide :user_role_add, :parent => :useradd, :source =>
+     value !~ /\s/
+   end
+ 
++  def shell=(value)
++    check_valid_shell
++    set("shell", value)
++  end
++
+   has_features :manages_homedir, :allows_duplicates, :manages_solaris_rbac, :manages_passwords, :manages_password_age, :manages_shell
+ 
++
++  def check_valid_shell
++    unless File.exists?(@resource.should(:shell))
++      raise(Puppet::Error, "Shell #{@resource.should(:shell)} must exist")
++    end
++    unless File.executable?(@resource.should(:shell).to_s)
++      raise(Puppet::Error, "Shell #{@resource.should(:shell)} must be executable")
++    end
++  end
++
+   #must override this to hand the keyvalue pairs
+   def add_properties
+     cmd = []