Documentation ¶
Index ¶
- Variables
- type AppImagePerms
- func (p *AppImagePerms) AddDevices(s ...string)
- func (p *AppImagePerms) AddFiles(s ...string)
- func (p *AppImagePerms) AddSockets(socketStrings ...string) error
- func (p *AppImagePerms) RemoveDevices(s ...string)
- func (p *AppImagePerms) RemoveFiles(s ...string)
- func (p *AppImagePerms) RemoveSockets(s ...string)
- func (p *AppImagePerms) SetLevel(l int) error
- type File
- type Socket
Constants ¶
This section is empty.
Variables ¶
View Source
var (
InvalidSocket = errors.New("socket invalid")
)
Functions ¶
This section is empty.
Types ¶
type AppImagePerms ¶
type AppImagePerms struct { Level int `json:"level"` // How much access to system files Files []string `json:"filesystem"` // Grant permission to access files Devices []string `json:"devices"` // Access device files (eg: dri, input) Sockets []Socket `json:"sockets"` // Use sockets (eg: x11, pulseaudio, network) // TODO: rename to PersistentHome or something DataDir bool `json:"data_dir"` // Whether or not a data dir should be created (only // Only intended for unmarshalling, should not be used for other purposes Names []string `json:"names"` }
func FromIni ¶
func FromIni(e *ini.File) (*AppImagePerms, error)
FromIni attempts to read permissions from a provided *ini.File, if fail, it will return an *AppImagePerms with a `Level` value of -1 and and error
func FromReader ¶
func FromReader(r io.Reader) (*AppImagePerms, error)
func FromSystem ¶
func FromSystem(name string) (*AppImagePerms, error)
FromSystem attempts to read permissions from a provided desktop entry at ~/.local/share/aisap/profiles/[ai.Name] This should be the preferred way to get permissions and gives maximum power to the user (provided they use a tool to easily edit these permissions, which I'm also planning on making)
func (*AppImagePerms) AddDevices ¶
func (p *AppImagePerms) AddDevices(s ...string)
func (*AppImagePerms) AddFiles ¶
func (p *AppImagePerms) AddFiles(s ...string)
func (*AppImagePerms) AddSockets ¶
func (p *AppImagePerms) AddSockets(socketStrings ...string) error
func (*AppImagePerms) RemoveDevices ¶
func (p *AppImagePerms) RemoveDevices(s ...string)
func (*AppImagePerms) RemoveFiles ¶
func (p *AppImagePerms) RemoveFiles(s ...string)
func (*AppImagePerms) RemoveSockets ¶
func (p *AppImagePerms) RemoveSockets(s ...string)
func (*AppImagePerms) SetLevel ¶
func (p *AppImagePerms) SetLevel(l int) error
Set sandbox base permission level
type Socket ¶
type Socket string
const ( X11 Socket = "x11" Alsa Socket = "alsa" Audio Socket = "audio" PulseAudio Socket = "pulseaudio" Wayland Socket = "wayland" Dbus Socket = "dbus" Cgroup Socket = "cgroup" Network Socket = "network" Pid Socket = "pid" Pipewire Socket = "pipewire" Session Socket = "session" User Socket = "user" Uts Socket = "uts" )
func SocketFromString ¶
Click to show internal directories.
Click to hide internal directories.