From 64c092708747eb6d989430ba947b9378b5aab59e Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Sun, 10 May 2015 17:39:53 +0800 Subject: [PATCH] sandbox: fix the rules 1. `script` (used to fake the tty) requires write access to /dev/ptmx and /dev/ttys* 2. sandbox profile only accepts `[0-9]` instead of `\d`. --- Library/Homebrew/sandbox.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb index f8988eef08..ab9f5f16fc 100644 --- a/Library/Homebrew/sandbox.rb +++ b/Library/Homebrew/sandbox.rb @@ -110,10 +110,11 @@ class Sandbox (debug deny) ; log all denied operations to /var/log/system.log <%= rules.join("\n") %> (allow file-write* + (literal "/dev/ptmx") (literal "/dev/dtracehelper") (literal "/dev/null") - (regex #"^/dev/fd/\\d+$") - (regex #"^/dev/tty\\d*$") + (regex #"^/dev/fd/[0-9]+$") + (regex #"^/dev/ttys?[0-9]*$") ) (deny file-write*) ; deny non-whitelist file write operations (allow default) ; allow everything else