Skip to content

Commit

Permalink
only respond to root owned files (#3969)
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom authored Nov 21, 2024
1 parent 063ef43 commit 144f627
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/dashboard/config/configuration_singleton.rb
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,10 @@ def can_access_core_app?(name)

def read_config
files = Pathname.glob(config_directory.join("*.{yml,yaml,yml.erb,yaml.erb}"))
files.sort.each_with_object({}) do |f, conf|
files.sort.select do |f|
# only resond to root owned files in production.
rails_env == 'production' ? File.stat(f).uid.zero? : true
end.each_with_object({}) do |f, conf|
begin
content = ERB.new(f.read, trim_mode: "-").result(binding)
yml = YAML.safe_load(content, aliases: true) || {}
Expand Down

0 comments on commit 144f627

Please sign in to comment.