components/ruby/puppet/patches/puppet-09-role-shell.patch
author Patrick Einheber <patrick.einheber@oracle.com>
Wed, 27 Apr 2016 14:55:10 -0700
changeset 5860 afd31ba91ee9
parent 5728 19424f2daf9f
permissions -rw-r--r--
23146903 Puppet and OpenStack modules need modification notices

--- puppet-3.8.6/lib/puppet/provider/user/user_role_add.rb.orig	2016-04-19 14:32:54.606087591 -0700
+++ puppet-3.8.6/lib/puppet/provider/user/user_role_add.rb	2016-04-19 14:34:04.451831050 -0700
@@ -1,3 +1,7 @@
+#######################################################################
+# Oracle has modified the originally distributed contents of this file.
+#######################################################################
+
 require 'puppet/util'
 require 'puppet/util/user_attr'
 require 'date'
@@ -12,6 +16,7 @@
   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,7 +31,22 @@
     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