mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-10 16:20:59 +00:00
Merge pull request #609 from tlevi/getgrgid_r
Group permission checks sometimes fail with large number of groups
This commit is contained in:
commit
f48826dfe9
@ -510,8 +510,17 @@ int is_uid_include_group(uid_t uid, gid_t gid)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
// get group information
|
// get group information
|
||||||
if(0 != (result = getgrgid_r(gid, &ginfo, pbuf, maxlen, &pginfo))){
|
while(ERANGE == (result = getgrgid_r(gid, &ginfo, pbuf, maxlen, &pginfo))){
|
||||||
S3FS_PRN_ERR("could not get group information.");
|
free(pbuf);
|
||||||
|
maxlen *= 2;
|
||||||
|
if(NULL == (pbuf = (char*)malloc(sizeof(char) * maxlen))){
|
||||||
|
S3FS_PRN_CRIT("failed to allocate memory.");
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(0 != result){
|
||||||
|
S3FS_PRN_ERR("could not get group information(%d).", result);
|
||||||
free(pbuf);
|
free(pbuf);
|
||||||
return -result;
|
return -result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user