From e35efc5b2d191580ab37f60bedfdec76d102ef2c Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Mon, 7 Mar 2022 10:16:34 +0100 Subject: [PATCH] fix check uid, gid values (#1309) --- 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 fa85271df..7285469da 100644 --- a/pkg/csplugin/broker.go +++ b/pkg/csplugin/broker.go @@ -425,14 +425,14 @@ func getProcessAtr(username string, groupname string) (*syscall.SysProcAttr, err if err != nil { return nil, err } - if uid < 0 && uid > math.MaxInt32 { + if uid < 0 || uid > math.MaxInt32 { return nil, fmt.Errorf("out of bound uid") } gid, err := strconv.ParseInt(g.Gid, 10, 32) if err != nil { return nil, err } - if gid < 0 && gid > math.MaxInt32 { + if gid < 0 || gid > math.MaxInt32 { return nil, fmt.Errorf("out of bound gid") } return &syscall.SysProcAttr{