Prevent fork bombing from cc -> tea symlinks

This commit is contained in:
Max Howell 2023-01-20 10:51:29 -05:00
parent cdcd5863c1
commit fd4fcf7fb7
2 changed files with 5 additions and 2 deletions

View file

@ -22,6 +22,9 @@ exe_path = ENV['PATH'].split(":").filter { |path|
path != File.dirname(__FILE__) path != File.dirname(__FILE__)
}.map { |path| }.map { |path|
"#{path}/#{exe}" "#{path}/#{exe}"
}.reject { |path|
# if the user created a symlink of `cc` to `tea` dont use it
File.symlink? path and File.basename(File.readlink(path)) == "tea"
}.find { |path| }.find { |path|
File.exist?(path) File.exist?(path)
} }

View file

@ -1,9 +1,9 @@
distributable: ~ distributable: ~
# FIXME we want the c version eg. c99 # FIXME we want the c version eg. c99
# or should that be some kind of option? so you specify you want a cc that support c99 # or should that be some kind of option? so you specify you want a cc that support c99
versions: versions:
- 0.1.2 - 0.1.3
dependencies: dependencies:
linux: linux: