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>
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>
stop the lookup for the dev/ino if there is not an ino open as it also
prevents reading the origin xattr.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
before doing a rename(2) make sure the destination is cleaned up,
otherwise a left-over directory can cause the rename to fail with
EEXIST.
Closes: https://github.com/containers/fuse-overlayfs/issues/189
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
when doing a lookup, make sure the returned file is not a whiteout for
functions that expect the file to exist.
Close: https://github.com/containers/fuse-overlayfs/issues/169
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
having the fd open with O_DIRECT causes pwrite64 to fail with EINVAL
if the write buffer is not aligned. Since we have no control on the
buffer provided by libfuse, just drop O_DIRECT.
Closes: https://github.com/containers/fuse-overlayfs/issues/167
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
If the call to `get_upper_layer(lo)` returns `NULL` then the
`node->layer` will be `NULL`, too. If this is the case we pass `NULL` to
`direct_fsync()` which will cause a segmentation fault in:
```c
cfd = openat(l->fd, path, O_NOFOLLOW|O_DIRECTORY);
```
To fix this we now apply an additional check and error in the case of
`get_upper_layer(lo) == NULL`.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>