From 2c9c7fee5b42d8f32be9ff55ad92345ae62c0af7 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 18 Feb 2025 17:36:58 +0900 Subject: linux: wrap fsu lookup error Signed-off-by: Ophestra --- print.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'print.go') diff --git a/print.go b/print.go index 3c0c219d..1022ae11 100644 --- a/print.go +++ b/print.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "log" + "os" "slices" "strconv" "strings" @@ -13,6 +14,7 @@ import ( "git.gensokyo.uk/security/fortify/dbus" "git.gensokyo.uk/security/fortify/fst" + "git.gensokyo.uk/security/fortify/internal/fmsg" "git.gensokyo.uk/security/fortify/internal/state" ) @@ -24,7 +26,8 @@ func printShowSystem(output io.Writer, short bool) { // get fid by querying uid of aid 0 if uid, err := sys.Uid(0); err != nil { - log.Fatalf("cannot obtain uid from fsu: %v", err) + fmsg.PrintBaseError(err, "cannot obtain uid from fsu:") + os.Exit(1) } else { info.User = (uid / 10000) - 100 } -- cgit v1.3.1