Skip to content

Commit 9e8ad51

Browse files
author
Nuo Yan
committed
CHEF-2185 Fix the client trying to modify frozen string in enforce_path_sanity
1 parent c241872 commit 9e8ad51

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

chef/lib/chef/client.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,10 @@ def enforce_path_sanity(env=ENV)
317317
existing_paths = env["PATH"].split(':')
318318
SANE_PATHS.each do |sane_path|
319319
unless existing_paths.include?(sane_path)
320-
env["PATH"] << ':' unless env["PATH"].empty?
321-
env["PATH"] << sane_path
320+
env_path = env["PATH"].dup
321+
env_path << ':' unless env["PATH"].empty?
322+
env_path << sane_path
323+
env["PATH"] = env_path
322324
end
323325
end
324326
end

0 commit comments

Comments
 (0)