[PR #605] [CLOSED] Group permission checks sometimes fail with large number of groups #1568

Closed
opened 2026-03-04 02:01:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/605
Author: @tlevi
Created: 5/22/2017
Status: Closed

Base: masterHead: master


📝 Commits (2)

  • 2b7ea58 Expand buffer for group information if too small and retry
  • 70bb649 Fix chown_nocopy losing existing uid/gid if unspecified

📊 Changes

2 files changed (+18 additions, -20 deletions)

View changed files

📝 src/s3fs.cpp (+7 -18)
📝 src/s3fs_util.cpp (+11 -2)

📄 Description

On some of my systems users cannot access directories, which they have group membership to access.
One if the groups in particular is quite large, with about 50 members, but I've also got ~150 groups and users in total.

I've traced the issue back to the getgrgid_r call within is_uid_include_group failing with ERANGE, indicating the buffer is too small.
The patch in this pull request solves the problem by expanding the buffer and trying again until it works, but there might be a better way.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/605 **Author:** [@tlevi](https://github.com/tlevi) **Created:** 5/22/2017 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`2b7ea58`](https://github.com/s3fs-fuse/s3fs-fuse/commit/2b7ea5813c39ea51b6f32c2f8997b2c95da64eb9) Expand buffer for group information if too small and retry - [`70bb649`](https://github.com/s3fs-fuse/s3fs-fuse/commit/70bb6494e3242aae8ef79116153f431c83200e49) Fix chown_nocopy losing existing uid/gid if unspecified ### 📊 Changes **2 files changed** (+18 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `src/s3fs.cpp` (+7 -18) 📝 `src/s3fs_util.cpp` (+11 -2) </details> ### 📄 Description On some of my systems users cannot access directories, which they have group membership to access. One if the groups in particular is quite large, with about 50 members, but I've also got ~150 groups and users in total. I've traced the issue back to the getgrgid_r call within is_uid_include_group failing with ERANGE, indicating the buffer is too small. The patch in this pull request solves the problem by expanding the buffer and trying again until it works, but there might be a better way. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:01:06 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#1568
No description provided.