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

Cannot delete files/directories that are not writable in lowerdir #325

Closed
yuyichao opened this issue Sep 28, 2021 · 1 comment
Closed

Cannot delete files/directories that are not writable in lowerdir #325

yuyichao opened this issue Sep 28, 2021 · 1 comment

Comments

@yuyichao
Copy link

ArchLinux, x86_64, kernel 5.14.7, latest git version of fuse-overlayfs

The following script attempts to delete two directory that are present in lowerdir owned by root.

mkdir -p {overlay,mount,upper,lower/v,lower/v2/A}
sudo chown -R root:root lower/{v,v2}
fuse-overlayfs -o "lowerdir=lower,upperdir=upper,workdir=overlay" "mount"

rm -rf "mount/v/"
rm -rf "mount/v2/"

It fails with

rm: cannot remove 'mount/v/': Operation not permitted
rm: cannot remove 'mount/v2/A': Permission denied

However, manually mknod in upper will cause the directory to be deleted (minus #324) so I think this could be supported.

@giuseppe
Copy link
Member

when we copyup a directory we also copy the directory ownership, and that operation fails with EPERM since an unprivileged user cannot chown to root:root.

When you are using fuse-overlayfs in unprivileged mode you need to make sure the user has access to all the files, otherwise it is suggested to run in a user namespace (which is the main use case for fuse-overlayfs).

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

No branches or pull requests

2 participants