You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
810 B

  1. Author: Kerma Gérald <gandalf@gk2.net>
  2. Date: Mon Sep 20 10:34:20 2021 +0200
  3. Use math.MaxInt32 instead of math.MaxUint32
  4. To fix 32 bits compilation in v1.2.0
  5. https://github.com/crowdsecurity/crowdsec/issues/979
  6. Signed-off-by: Kerma Gérald <gandalf@gk2.net>
  7. --- a/pkg/csplugin/broker.go
  8. +++ b/pkg/csplugin/broker.go
  9. @@ -400,14 +400,14 @@ func getProccessAtr(username string, gro
  10. if err != nil {
  11. return nil, err
  12. }
  13. - if uid < 0 && uid > math.MaxUint32 {
  14. + if uid < 0 && uid > math.MaxInt32 {
  15. return nil, fmt.Errorf("out of bound uid")
  16. }
  17. gid, err := strconv.Atoi(g.Gid)
  18. if err != nil {
  19. return nil, err
  20. }
  21. - if gid < 0 && gid > math.MaxUint32 {
  22. + if gid < 0 && gid > math.MaxInt32 {
  23. return nil, fmt.Errorf("out of bound gid")
  24. }
  25. return &syscall.SysProcAttr{