aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/linux/interface.go
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-11-16 21:19:45 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-11-16 21:19:45 +0900
commitdf33123bd7f1e0cb4e98580b7e63818c82aa7206 (patch)
tree8b21831634e6169eb875cbfd359fa4006d6c66b3 /internal/linux/interface.go
parent1a09b55bd4753c6d5cbecf96d1b56f23b0e44b95 (diff)
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 <cat@ophivana.moe>
Diffstat (limited to 'internal/linux/interface.go')
-rw-r--r--internal/linux/interface.go8
1 files changed, 4 insertions, 4 deletions
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
}