Skip to content

Commit

Permalink
sandbox: fix /bin/sh on catalina
Browse files Browse the repository at this point in the history
Sadly 10.15 changed /bin/sh to a shim which executes bash, this means it
can't be used anymore without also opening up the sandbox to allow bash.

    Failed to exec /bin/bash as variant for /bin/sh (1: Operation not permitted).
  • Loading branch information
LnL7 committed Mar 20, 2020
1 parent f6c122a commit 2e9bc12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstore/globals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Settings::Settings()

/* chroot-like behavior from Apple's sandbox */
#if __APPLE__
sandboxPaths = tokenizeString<StringSet>("/System/Library/Frameworks /System/Library/PrivateFrameworks /bin/sh /private/tmp /private/var/tmp /usr/lib");
sandboxPaths = tokenizeString<StringSet>("/System/Library/Frameworks /System/Library/PrivateFrameworks /bin/sh /bin/bash /private/tmp /private/var/tmp /usr/lib");
allowedImpureHostPrefixes = tokenizeString<StringSet>("/System/Library /usr/lib /dev /bin/sh");
#endif
}
Expand Down
4 changes: 4 additions & 0 deletions src/libstore/sandbox-defaults.sb
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,7 @@
(literal "/etc")
(literal "/var")
(literal "/private/var/tmp"))

; This is used by /bin/sh on macOS 10.15 and later.
(allow file*
(literal "/private/var/select/sh"))

0 comments on commit 2e9bc12

Please sign in to comment.