Use math.MaxInt32 instead of math.MaxUint32 (#980)

To fix 32 bits compilation in v1.2.0
https://github.com/crowdsecurity/crowdsec/issues/979

Signed-off-by: Kerma Gérald <gandalf@gk2.net>
This commit is contained in:
Kerma Gérald 2021-11-15 12:14:04 +01:00 committed by GitHub
parent 0ffbbbec61
commit 37c2a10e21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -412,14 +412,14 @@ func getProcessAtr(username string, groupname string) (*syscall.SysProcAttr, err
if err != nil {
return nil, err
}
if uid < 0 && uid > math.MaxUint32 {
if uid < 0 && uid > math.MaxInt32 {
return nil, fmt.Errorf("out of bound uid")
}
gid, err := strconv.Atoi(g.Gid)
if err != nil {
return nil, err
}
if gid < 0 && gid > math.MaxUint32 {
if gid < 0 && gid > math.MaxInt32 {
return nil, fmt.Errorf("out of bound gid")
}
return &syscall.SysProcAttr{