From 37c2a10e21c343d2e3cc7153f46329fc8f6bbd01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kerma=20G=C3=A9rald?= Date: Mon, 15 Nov 2021 12:14:04 +0100 Subject: [PATCH] Use math.MaxInt32 instead of math.MaxUint32 (#980) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To fix 32 bits compilation in v1.2.0 https://github.com/crowdsecurity/crowdsec/issues/979 Signed-off-by: Kerma GĂ©rald --- pkg/csplugin/broker.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/csplugin/broker.go b/pkg/csplugin/broker.go index a4e860bd2..c8cc94e78 100644 --- a/pkg/csplugin/broker.go +++ b/pkg/csplugin/broker.go @@ -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{