Skip to content

Commit

Permalink
fix UID / GID
Browse files Browse the repository at this point in the history
  • Loading branch information
psych0d0g committed Dec 17, 2023
1 parent b565878 commit 5ff2c8f
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions verify_pw.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/base64"
"fmt"
"os"
"os/user"
"strconv"
"strings"

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 5ff2c8f

Please sign in to comment.