Module: OS::Linux::Sandbox Private

Extended by:
T::Helpers
Included in:
Sandbox
Defined in:
extend/os/linux/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.

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#allow_cvs ⇒ void

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.

This method returns an undefined value.



25
26
27
28
# File 'extend/os/linux/sandbox.rb', line 25

def allow_cvs
  cvspass = ::Pathname.new("#{Dir.home(ENV.fetch("USER"))}/.cvspass")
  allow_write path: cvspass, type: :literal if cvspass.exist?
end

#allow_fossil ⇒ void

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.

This method returns an undefined value.



31
32
33
34
35
36
# File 'extend/os/linux/sandbox.rb', line 31

def allow_fossil
  [".fossil", ".fossil-journal"].each do |file|
    fossil_file = ::Pathname.new("#{Dir.home(ENV.fetch("USER"))}/#{file}")
    allow_write path: fossil_file, type: :literal if fossil_file.exist?
  end
end

#allow_write_system_temp ⇒ void

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.

This method returns an undefined value.



18
19
20
21
22
# File 'extend/os/linux/sandbox.rb', line 18

def allow_write_system_temp
  allow_write_path "/tmp"
  allow_write_path "/var/tmp"
  super
end

#apply! ⇒ void

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.

This method returns an undefined value.



86
87
88
# File 'extend/os/linux/sandbox.rb', line 86

def apply!
  landlock.apply!
end

#apply_before_exec? ⇒ 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.

Returns:

  • (Boolean)


78
# File 'extend/os/linux/sandbox.rb', line 78

def apply_before_exec? = true

#cleanup_sandbox ⇒ void

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.

This method returns an undefined value.



81
82
83
# File 'extend/os/linux/sandbox.rb', line 81

def cleanup_sandbox
  landlock.cleanup
end