From 5ff2c8ff828882ac8007c9603d5c9bf56e50111f Mon Sep 17 00:00:00 2001 From: Lukas Wingerberg Date: Sun, 17 Dec 2023 16:17:25 +0100 Subject: [PATCH] fix UID / GID --- verify_pw.go | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/verify_pw.go b/verify_pw.go index 9889a7f..8ba7fc5 100644 --- a/verify_pw.go +++ b/verify_pw.go @@ -6,7 +6,6 @@ import ( "encoding/base64" "fmt" "os" - "os/user" "strconv" "strings" @@ -165,20 +164,9 @@ func getDatabaseQuery(engine, username string) (string, []interface{}) { } func getCurrentUserIDs() (int, int) { - currentUser, err := user.Current() - if err != nil { - handleError("Failed to get current user information", failedAuthFatalError) - } - - uid, err := strconv.Atoi(currentUser.Uid) - if err != nil { - handleError("Failed to convert UID to integer", failedAuthFatalError) - } - - gid, err := strconv.Atoi(currentUser.Gid) - if err != nil { - handleError("Failed to convert GID to integer", failedAuthFatalError) - } + // Obtain the UID and GID of the current process + uid := os.Getuid() + gid := os.Getgid() return uid, gid }