Skip to content

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

Open
a-wai wants to merge 2 commits intosgan81:masterfrom
a-wai:uid_gid_options
Open

Add support for setting UID/GID through mount options#62
a-wai wants to merge 2 commits intosgan81:masterfrom
a-wai:uid_gid_options

Conversation

@a-wai
Copy link
Copy Markdown
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 <arnaud.ferraris@collabora.com>
@a-wai
Copy link
Copy Markdown
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.

Comment thread apfsfuse/ApfsFuse.cpp
st.st_uid = geteuid();
st.st_gid = getegid();
st.st_uid = g_uid;
st.st_uid = g_gid;
Copy link
Copy Markdown

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
Copy Markdown

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