Allow sandbox access to /dev/ptmx and /dev/ttys*

This allows Expect, which is sometimes needed to automate interaction
with particularly pesky programs that require user input, to be used in
a Portfile.

https://lists.macports.org/pipermail/macports-dev/2018-April/038382.html
This commit is contained in:
Ryan Schmidt
2018-04-20 03:12:46 -05:00
parent d20ca4ae4e
commit 8765c14223
+5
View File
@@ -90,6 +90,11 @@ proc portsandbox::set_profile {target} {
(regex #\"^/dev/fd/\")) (allow file-write* \
(regex #\"^(/private)?(/var)?/tmp/\" #\"^(/private)?/var/folders/\" #\"^(/private)?/var/db/mds/\"))"
# allow access to ptys
append portsandbox_profile "\
(allow file-write-data (regex #\"^/dev/ttys\") (literal \"/dev/ptmx\")) \
(allow file-write-mode (regex #\"^/dev/ttys\"))"
set perms [list file-write*]
if {${os.major} >= 17} {
lappend perms file-write-setugid