From 82107f4b6c4cf455c2f3dd63e0ade29f042c1b0f Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sat, 26 Aug 2023 23:24:33 -0700 Subject: [PATCH] Skip is_uid_include_group when GID available (#2292) This can avoid an expensive computation which is 20% of test runtime. --- src/s3fs.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/s3fs.cpp b/src/s3fs.cpp index c640f47..02aa9ba 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -819,8 +819,7 @@ static int check_object_access(const char* path, int mask, struct stat* pstbuf) } if(pcxt->gid == obj_gid){ base_mask |= S_IRWXG; - } - if(1 == is_uid_include_group(pcxt->uid, obj_gid)){ + } else if(1 == is_uid_include_group(pcxt->uid, obj_gid)){ base_mask |= S_IRWXG; } mode &= base_mask;