Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "sandbox: deny signal to other processes" #17759

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Library/Homebrew/sandbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ class SandboxProfile
(literal "/bin/ps")
(with no-sandbox)
) ; allow certain processes running without sandbox
(deny signal (target others)) ; deny sending signals to other processes
(allow default) ; allow everything else
ERB

Expand Down
18 changes: 0 additions & 18 deletions Library/Homebrew/test/sandbox_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,4 @@ def initialize(*, **)
end
end
end

describe "disallow sending signal to other processes" do
# we have to spawn a process, otherwise kill doesn't try to send a signal if the process doesn't exist
let(:pid) do
pid = spawn("sleep 1000")
sleep 0.1 # Ensure the process has started
pid
end

after do
Process.kill("KILL", pid)
Process.wait(pid)
end

it "sandbox stops signal to other processes" do
expect { sandbox.exec "kill", "-SIGTERM", pid.to_s }.to raise_error(ErrorDuringExecution)
end
end
end