diff options
Diffstat (limited to 'lib/chef/provider/user/dscl.rb')
-rw-r--r-- | lib/chef/provider/user/dscl.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/provider/user/dscl.rb b/lib/chef/provider/user/dscl.rb index bc865b17c5..1d8ad5e6ee 100644 --- a/lib/chef/provider/user/dscl.rb +++ b/lib/chef/provider/user/dscl.rb @@ -237,7 +237,7 @@ user password using shadow hash.") next_uid_guess = base_uid users_uids = run_dscl("list", "/Users", "uid") while next_uid_guess < search_limit + base_uid - if users_uids =~ Regexp.new("#{Regexp.escape(next_uid_guess.to_s)}\n") + if users_uids.match?(Regexp.new("#{Regexp.escape(next_uid_guess.to_s)}\n")) next_uid_guess += 1 else uid = next_uid_guess @@ -312,7 +312,7 @@ user password using shadow hash.") end def validate_home_dir_specification! - unless new_resource.home =~ /^\// + unless new_resource.home.match?(/^\//) raise(Chef::Exceptions::InvalidHomeDirectory, "invalid path spec for User: '#{new_resource.username}', home directory: '#{new_resource.home}'") end end |