Skip to content

Commit

Permalink
cpuns: use syscall.Get[ug]id, not os.Get[ug]id
Browse files Browse the repository at this point in the history
os.Get[ug]id can do more than is wanted on some systems.
cpuns needs the rawest possible result.

Signed-off-by: the man <rminnich@google.com>
  • Loading branch information
rminnichcodeu committed Sep 26, 2024
1 parent b10ba2a commit 7ebfe67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmds/cpuns/main_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ func main() {
}

// the default value of uid, gid is 0
uid := uint32(os.Getuid())
gid := uint32(os.Getgid())
uid := uint32(syscall.Getuid())
gid := uint32(syscall.Getgid())
if u, ok := os.LookupEnv("SUDO_UID"); ok {
i, err := strconv.ParseUint(u, 0, 32)
if err != nil {
Expand Down

0 comments on commit 7ebfe67

Please sign in to comment.