when device whiteouts are created (supported for unprivileged users in
newer Linux kernels) make sure the RENAME_NOREPLACE flag is dropped
when renaming the file on top of an existing whiteout.
Closes: https://github.com/containers/fuse-overlayfs/issues/273
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
on newer kernels unprivileged users can create whiteout devices. If
the whiteout device creation failed with EEXIST, check whether the
existing file is already a whiteout.
Closes: https://github.com/containers/fuse-overlayfs/issues/271
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
if we are adding a new file to a directory, the parent directory must
be invalidated if it is in the middle of a opendir/releasedir
otherwise the added files won't be cached.
Closes: https://github.com/containers/fuse-overlayfs/issues/259
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
if a file is delete and not accessible from the file system, but it is
still referenced, we must be able to open and use it.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
upstream Linux added an option "volatile" for overlay mounts that has
the same meaning as fsync=0 already supported by fuse-overlayfs.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
make sure the inodes are created with mode 0755 when using
xattr_permissions, otherwise the original permission could prevent
running on NFS. Requires Linux 5.9 for NFS with xattr support.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
if the reference held by the directory is the last one, it would miss
to clean up the inode. Fix it by calling do_forget.
Closes: https://github.com/containers/fuse-overlayfs/issues/238
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
adding the .wh. prefix could cause the lookup to cross the f_namemax
limit and fail the lookup with ENAMETOOLONG. If the lookup fails with
ENAMETOOLONG then the whiteout file doesn't exist.
Closes: https://github.com/containers/fuse-overlayfs/issues/236
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
honor the specified flags to fchownat.
commit 50787d38278fa41c1b3f8167ccfe13ec83d9a063 introduced the
regression.
Closes: https://github.com/containers/fuse-overlayfs/issues/233
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
utils.c: file_exists_at: fallback to `fstatat` when `faccessat` fails with `EINVAL` (on musl).
.travis.yml: alpine test added.
main.c: reallocate path before appending.
Closes#174.
Signed-off-by: Max Goltzsche <max.goltzsche@gmail.com>
we were mistakenly using the overflow GID also for UIDs lookups. Not
a big issue as they usually have the same value.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
if the destination already exists as it could not be properly cleaned
up, attempt to atomically swap the two directories and free the old
one.
Closes: https://github.com/containers/fuse-overlayfs/issues/213
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
the copyup function returns the error code set in ret. Make sure ret
has the correct return code if set_fd_origin fails.
Closes: https://github.com/containers/fuse-overlayfs/issues/211
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>