瀏覽代碼

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>
Kerma Gérald 3 年之前
父節點
當前提交
37c2a10e21
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      pkg/csplugin/broker.go

+ 2 - 2
pkg/csplugin/broker.go

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