I have an executable (Google Chrome) that apparently "is running setugid()". I cannot find a way to make it work when called from within a /usr/bin/sandbox-exec
sandbox without sudo.
Given the following sandbox profile:
(version 1)
(allow process-exec
(literal "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome")
(literal "/usr/bin/sudo")
(with no-sandbox)
)
The following two commands work:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
/usr/bin/sandbox-exec -f ./profile.sb sudo /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
(although the second one is really not smart) but this does not work:
$ /usr/bin/sandbox-exec -f ./profile.sb /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
2022-06-07 23:06:50.267 Google Chrome[21533:679255] The application with bundle ID com.google.Chrome is running setugid(), which is not allowed. Exiting.
I'm not sure what's preventing chrome from "running setugid()". I've read somewhere that it's something called "AppKit", but I'm not sure how it gets involved here. Is there a way to have sandbox-exec
allow the chrome process to do what it needs, without sudo?
Any help is appreciated.