From 6955545648d0517fd10972881d08a928048ef41e Mon Sep 17 00:00:00 2001 From: iposadat Date: Fri, 5 Mar 2021 15:51:14 +0100 Subject: [PATCH] Allow statping to be executed with restricted scc, not only root --- utils/utils_custom.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/utils_custom.go b/utils/utils_custom.go index 90253d60..9d09e62d 100644 --- a/utils/utils_custom.go +++ b/utils/utils_custom.go @@ -31,7 +31,7 @@ func DirWritable(path string) (bool, error) { return false, errors.New("unable to get stat") } - if uint32(os.Geteuid()) != stat.Uid { + if uint32(os.Getgid()) != stat.Gid && uint32(os.Geteuid()) != stat.Uid { return false, errors.New("user doesn't have permission to write to this directory") } return true, nil