Fix imports

This commit is contained in:
Neil Alexander 2024-08-03 20:58:41 +01:00
parent cb29747e43
commit a2f35a3f7f
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -4,7 +4,9 @@
package main
import (
"errors"
"fmt"
"math"
osuser "os/user"
"strconv"
"strings"
@ -51,11 +53,11 @@ func chuser(user string) error {
gid, _ := strconv.ParseUint(g.Gid, 10, 32)
var err error
if gid < math.MaxInt {
err = syscall.Setgid(int(gid))
err = syscall.Setgid(int(gid))
} else {
err = errors.New("gid too big")
err = errors.New("gid too big")
}
if err != nil {
return fmt.Errorf("failed to setgid %d: %v", gid, err)
}
@ -71,11 +73,11 @@ func chuser(user string) error {
uid, _ := strconv.ParseUint(u.Uid, 10, 32)
var err error
if uid < math.MaxInt {
err = syscall.Setuid(int(uid))
err = syscall.Setuid(int(uid))
} else {
err = errors.New("uid too big")
err = errors.New("uid too big")
}
if err != nil {
return fmt.Errorf("failed to setuid %d: %v", uid, err)
}