From 7c063833e01930b4b298a59363b783ab32cc0e41 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 17 Mar 2025 17:10:03 +0900 Subject: internal/sys: wrap getuid/getgid Signed-off-by: Ophestra --- internal/sys/interface.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'internal/sys/interface.go') diff --git a/internal/sys/interface.go b/internal/sys/interface.go index 0d2ebaf3..935cee5c 100644 --- a/internal/sys/interface.go +++ b/internal/sys/interface.go @@ -12,8 +12,10 @@ import ( // State provides safe interaction with operating system state. type State interface { - // Geteuid provides [os.Geteuid]. - Geteuid() int + // Getuid provides [os.Getuid]. + Getuid() int + // Getgid provides [os.Getgid]. + Getgid() int // LookupEnv provides [os.LookupEnv]. LookupEnv(key string) (string, bool) // TempDir provides [os.TempDir]. @@ -47,7 +49,7 @@ type State interface { // CopyPaths is a generic implementation of [System.Paths]. func CopyPaths(os State, v *fst.Paths) { - v.SharePath = path.Join(os.TempDir(), "fortify."+strconv.Itoa(os.Geteuid())) + v.SharePath = path.Join(os.TempDir(), "fortify."+strconv.Itoa(os.Getuid())) fmsg.Verbosef("process share directory at %q", v.SharePath) -- cgit v1.3.1