fakeroot

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EngineOperations

type EngineOperations struct {
	CommonConfig *config.Common               `json:"-"`
	EngineConfig *fakerootConfig.EngineConfig `json:"engineConfig"`
}

EngineOperations is an Apptainer fakeroot runtime engine that implements engine.Operations.

func (*EngineOperations) CleanupContainer

func (e *EngineOperations) CleanupContainer(context.Context, error, syscall.WaitStatus) error

CleanupContainer does nothing for the fakeroot engine.

func (*EngineOperations) Config

func (e *EngineOperations) Config() config.EngineConfig

Config returns a pointer to a fakerootConfig.EngineConfig literal as a config.EngineConfig interface. This pointer gets stored in the engine.Engine.Common field.

Since this method simply returns a zero value of the concrete EngineConfig, it does not matter whether or not there are any elevated privileges during this call.

func (*EngineOperations) CreateContainer

func (e *EngineOperations) CreateContainer(context.Context, int, net.Conn) error

CreateContainer does nothing for the fakeroot engine.

func (*EngineOperations) InitConfig

func (e *EngineOperations) InitConfig(cfg *config.Common, privStageOne bool)

InitConfig stores the parsed config.Common inside the engine.

Since this method simply stores config.Common, it does not matter whether or not there are any elevated privileges during this call.

func (*EngineOperations) MonitorContainer

func (e *EngineOperations) MonitorContainer(pid int, signals chan os.Signal) (syscall.WaitStatus, error)

MonitorContainer is called from master once the container has been spawned. It will block until the container exists.

Additional privileges may be gained when running hybrid flow.

Particularly here no additional privileges are gained as monitor does not need them for wait4 and kill syscalls.

func (*EngineOperations) PostStartProcess

func (e *EngineOperations) PostStartProcess(ctx context.Context, pid int) error

PostStartProcess does nothing for the fakeroot engine.

func (*EngineOperations) PrepareConfig

func (e *EngineOperations) PrepareConfig(starterConfig *starter.Config) error

PrepareConfig is called during stage1 to validate and prepare container configuration. It is responsible for apptainer configuration file parsing, reading capabilities, configuring UID/GID mappings, etc.

No additional privileges can be gained as any of them are already dropped by the time PrepareConfig is called.

func (*EngineOperations) StartProcess

func (e *EngineOperations) StartProcess(masterConnFd int) error

StartProcess is called during stage2 after RPC server finished environment preparation. This is the container process itself. It will execute command in the fakeroot context.

This will be executed as a fake root user in a new user namespace (PrepareConfig will set both).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL