Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for setting UID/GID through mount options #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add support for setting UID/GID through mount options #62

wants to merge 2 commits into from

Conversation

a-wai
Copy link
Contributor

@a-wai a-wai commented Sep 12, 2018

Hi,

The use-case is the following one:

  • Mount an APFS read-only
  • Create and overlayfs with the lower dir on the APFS directory and the upper dir on a user-writable partition
  • The user cannot create a file in a subdirectory of the overlayfs as it is owned by root on the original filesystem with 755 permissions

Setting UID/GID for the whole APFS filesystem enables regular users writing to the overlayfs.

This patch solves issue #61

a-wai and others added 2 commits September 12, 2018 17:46
Even with read-only support, it may be useful to set the filesystem
default UID/GID to an arbitrary value.

With this patch, the user can use the "uid=N", "gid=N", "user_id=N" or
"group_id=N" options to set the user and group IDs for the whole
filesystem.

Signed-off-by: Arnaud Ferraris <[email protected]>
@a-wai
Copy link
Contributor Author

a-wai commented Oct 11, 2018

Merged master to solve conflicts, feel free to let me know if you have any comments regarding this PR.

st.st_uid = geteuid();
st.st_gid = getegid();
st.st_uid = g_uid;
st.st_uid = g_gid;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That can't be right. Did you mean to set st.st_gid?

@nros
Copy link

nros commented Jun 22, 2022

The PR seems already merged with commit d9ae52c
So, this can be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants