Module: OS::Mac::Sandbox::ClassMethods Private
- Extended by:
- T::Helpers
- Defined in:
- extend/os/mac/sandbox.rb
This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.
Instance Method Summary collapse
- #available? ⇒ Boolean private
-
#nested_sandbox? ⇒ Boolean
private
Nested
sandbox-execinvocations hang inside an existing macOS sandbox (e.g. an agent's), so detect that via the libSystemsandbox_checksyscall. - #terminal_ioctl_request ⇒ Integer private
Instance Method Details
#available? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
88 89 90 |
# File 'extend/os/mac/sandbox.rb', line 88 def available? File.executable?(SANDBOX_EXEC) end |
#nested_sandbox? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
Nested sandbox-exec invocations hang inside an existing macOS sandbox
(e.g. an agent's), so detect that via the libSystem sandbox_check
syscall. The shared avoid_nested_sandboxing? only calls this once the
$HOMEBREW_AVOID_NESTED_SANDBOXING opt-in is set.
97 98 99 100 101 102 103 104 105 106 |
# File 'extend/os/mac/sandbox.rb', line 97 def nested_sandbox? sandbox_check = Fiddle::Function.new( Fiddle.dlopen(nil)["sandbox_check"], [Fiddle::TYPE_INT, Fiddle::TYPE_VOIDP, Fiddle::TYPE_INT], Fiddle::TYPE_INT, ) sandbox_check.call(Process.pid, nil, 0) == 1 rescue Fiddle::DLError false end |
#terminal_ioctl_request ⇒ Integer
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
109 110 111 |
# File 'extend/os/mac/sandbox.rb', line 109 def terminal_ioctl_request TIOCSCTTY end |