From df33123bd7f1e0cb4e98580b7e63818c82aa7206 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Sat, 16 Nov 2024 21:19:45 +0900 Subject: app: integrate fsu This removes the dependency on external user switchers like sudo/machinectl and decouples fortify user ids from the passwd database. Signed-off-by: Ophestra Umiker --- internal/linux/interface.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/linux/interface.go') diff --git a/internal/linux/interface.go b/internal/linux/interface.go index 36f61b1a..a920492f 100644 --- a/internal/linux/interface.go +++ b/internal/linux/interface.go @@ -22,8 +22,8 @@ type System interface { LookPath(file string) (string, error) // Executable provides [os.Executable]. Executable() (string, error) - // Lookup provides [user.Lookup]. - Lookup(username string) (*user.User, error) + // LookupGroup provides [user.LookupGroup]. + LookupGroup(name string) (*user.Group, error) // ReadDir provides [os.ReadDir]. ReadDir(name string) ([]fs.DirEntry, error) // Stat provides [os.Stat]. @@ -35,10 +35,10 @@ type System interface { // Stdout provides [os.Stdout]. Stdout() io.Writer - // FshimPath returns an absolute path to the fshim binary. - FshimPath() string // Paths returns a populated [Paths] struct. Paths() Paths + // Uid invokes fsu and returns target uid. + Uid(aid int) (int, error) // SdBooted implements https://www.freedesktop.org/software/systemd/man/sd_booted.html SdBooted() bool } -- cgit v1.3.1