Skip to content

Commit

Permalink
updated the IO.read to File.read to fix vulenrability (#3290)
Browse files Browse the repository at this point in the history
Signed-off-by: nikhil2611 <[email protected]>
  • Loading branch information
nikhil2611 authored Jan 13, 2025
1 parent 5772aa4 commit a9e5b83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions omnibus/config/projects/chef-workstation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
end

version_file = File.expand_path("../../../VERSION", __dir__)
build_version IO.read(version_file).strip
build_version File.read(version_file).strip
build_iteration 1

# In order to prevent unnecessary cache expiration,
# package and package version overrides, build_version
# and build_iteration are kept in <project-root>/omnibus_overrides.rb
overrides_path = File.expand_path("../../../omnibus_overrides.rb", __dir__)
instance_eval(IO.read(overrides_path), overrides_path)
instance_eval(File.read(overrides_path), overrides_path)

dependency "preparation"

Expand Down
2 changes: 1 addition & 1 deletion omnibus/config/software/powershell-scripts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
create_directory(psm1_path)
chef_module_dir = "#{install_dir}/modules/chef"
create_directory(chef_module_dir)
template = ERB.new(IO.read(template_file))
template = ERB.new(File.read(template_file))
chef_psm1 = template.result
File.open(::File.join(psm1_path, "chef.psm1"), "w") { |f| f.write(chef_psm1) }
Dir.glob("#{chef_gem_path}/distro/powershell/chef/*").each do |file|
Expand Down

0 comments on commit a9e5b83

Please sign in to comment.