diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-02-15 02:56:08 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-02-15 03:06:10 +0900 |
| commit | ea8d1c07df18ceb94932fcc94ad00eb57c99da33 (patch) | |
| tree | 84dd16fd18987542cbf5840b0727374627517f82 /internal/linux | |
| parent | a0062d827515c092cae7dfcf1af0033b87b3e90e (diff) | |
priv/shim: move /sbin/init setup to app
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/linux')
| -rw-r--r-- | internal/linux/interface.go | 4 | ||||
| -rw-r--r-- | internal/linux/std.go | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/internal/linux/interface.go b/internal/linux/interface.go index 1bb87db9..68129363 100644 --- a/internal/linux/interface.go +++ b/internal/linux/interface.go @@ -19,8 +19,8 @@ type System interface { TempDir() string // LookPath provides [exec.LookPath]. LookPath(file string) (string, error) - // Executable provides [os.Executable]. - Executable() (string, error) + // MustExecutable provides [proc.MustExecutable]. + MustExecutable() string // LookupGroup provides [user.LookupGroup]. LookupGroup(name string) (*user.Group, error) // ReadDir provides [os.ReadDir]. diff --git a/internal/linux/std.go b/internal/linux/std.go index 08f031ed..1434f1be 100644 --- a/internal/linux/std.go +++ b/internal/linux/std.go @@ -11,6 +11,7 @@ import ( "sync" "syscall" + "git.gensokyo.uk/security/fortify/helper/proc" "git.gensokyo.uk/security/fortify/internal" "git.gensokyo.uk/security/fortify/internal/fmsg" ) @@ -32,7 +33,7 @@ func (s *Std) Geteuid() int { return os.Geteuid( func (s *Std) LookupEnv(key string) (string, bool) { return os.LookupEnv(key) } func (s *Std) TempDir() string { return os.TempDir() } func (s *Std) LookPath(file string) (string, error) { return exec.LookPath(file) } -func (s *Std) Executable() (string, error) { return os.Executable() } +func (s *Std) MustExecutable() string { return proc.MustExecutable() } func (s *Std) LookupGroup(name string) (*user.Group, error) { return user.LookupGroup(name) } func (s *Std) ReadDir(name string) ([]os.DirEntry, error) { return os.ReadDir(name) } func (s *Std) Stat(name string) (fs.FileInfo, error) { return os.Stat(name) } |
