616 Commits

Author SHA1 Message Date
Giuseppe Scrivano
d4188a4f59
main, rename: fix leak on error
fix a fd leak on the error exit path.

Closes: https://github.com/containers/fuse-overlayfs/issues/289

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-04-16 20:36:35 +02:00
Giuseppe Scrivano
af5cb1c04c
Merge pull request #288 from cptpcrd/utimensat-fix
Fix flaws in utimensat() handling
2021-04-16 20:35:57 +02:00
cptpcrd
defd480c0e main: improve UTIME_NOW special-casing
FUSE never passes FUSE_SET_ATTR_ATIME_NOW without also passing
FUSE_SET_ATTR_ATIME. Since FUSE_SET_ATTR_ATIME_NOW was only checked if
FUSE_SET_ATTR_ATIME was not set, it would never be triggered.

Note that this is an *improvement*, not a *fix*, because FUSE always
passes the current time in st_atim whenever it sets
FUSE_SET_ATTR_ATIME_NOW. As a result, the previous code works properly,
but it does so differently from the way it was intended to.

(All of the above descriptions of st_atim handling also applies to
st_mtim.)
2021-04-13 21:33:00 -04:00
cptpcrd
d23dbe914d main: tv_sec -> tv_nsec
As specified in utimensat(2), *tv_nsec*, not *tv_sec*, should be set to
UTIME_NOW or UTIME_OMIT.

The way this bug manifests is that if utimensat() is called with
one of the timestamps set to UTIME_OMIT, fuse-overlayfs will
accidentally reset the timestamp to 1073741822, which is 2004-01-10
13:37:02 UTC.
2021-04-13 21:32:57 -04:00
Giuseppe Scrivano
6457fd46c0
Merge pull request #285 from giuseppe/tag-1.5
NEWS: tag 1.5
2021-03-24 18:07:20 +01:00
Giuseppe Scrivano
e90bcb77f3
NEWS: tag 1.5
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
v1.5.0
2021-03-23 12:11:26 +01:00
Daniel J Walsh
30775315a6
Merge pull request #286 from giuseppe/fix-copyup-long-xattr
main: fix reading xattrs longer than 256 bytes
2021-03-23 06:46:21 -04:00
Giuseppe Scrivano
11ad142525
main: fix reading xattrs longer than 256 bytes
fix reading extended attributes longer than 256 bytes.

Closes: https://github.com/containers/fuse-overlayfs/issues/284

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-21 17:50:06 +01:00
Giuseppe Scrivano
f6b0d2eaea
Merge pull request #282 from dhedberg/master
main: Add option static_nlink to set st_nlink to 1 for all directories
2021-03-17 21:08:50 +01:00
David Hedberg
5ec356b29e main: Add option static_nlink to set st_nlink to 1 for all directories
Skips calculation of st_nlink for directories, which can be
expensive on higher latency file systems such as NFS.

Signed-off-by: David Hedberg <david.hedberg@gmail.com>
2021-03-16 18:51:42 +01:00
Daniel J Walsh
1f1377d880
Merge pull request #280 from giuseppe/rm-whiteout-symlink
main: mark directory not loaded on rename
2021-03-05 14:22:40 -05:00
Giuseppe Scrivano
d612d48326
main: mark directory not loaded on rename
if a whiteout was created as part of a rename operation, mark the
directory content as not loaded so to avoid some optimizations when a
whiteout file must be deleted.

Closes: https://github.com/containers/fuse-overlayfs/issues/279

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-05 17:51:18 +01:00
Giuseppe Scrivano
062ec18711
main: honor FUSE_OVERLAYFS_DISABLE_OVL_WHITEOUT also for renames
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-05 14:56:55 +01:00
Giuseppe Scrivano
0d77a9fdd0
main: simplify logic for FUSE_OVERLAYFS_DISABLE_OVL_WHITEOUT
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-05 14:56:35 +01:00
Daniel J Walsh
d085fa9ade
Merge pull request #278 from giuseppe/fix-static-analysis
src: fix some defects found by static analysis
2021-03-04 15:39:49 -05:00
Giuseppe Scrivano
5530c154d8
tests: fix test
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-04 12:00:12 +01:00
Giuseppe Scrivano
95a0a8999b
tests: install ffjson
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-04 11:45:22 +01:00
Giuseppe Scrivano
44561349cd
main: use strncpy instead of strcpy
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-04 11:04:48 +01:00
Giuseppe Scrivano
c1fd9a7e0b
main: ignore write error
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-04 11:03:14 +01:00
Giuseppe Scrivano
360a0c6bfd
main: drop unused variable
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-04 11:02:37 +01:00
Giuseppe Scrivano
446e99e4c6
utils: fix double definition for _GNU_SOURCE
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-04 11:02:03 +01:00
Giuseppe Scrivano
5df063677b
main: check for asprintf return code
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-04 11:00:46 +01:00
Daniel J Walsh
ee8ce2eb5c
Merge pull request #274 from giuseppe/NO_REPLACE-with-whiteouts
fuse-overlayfs: fix renameat2(RENAME_NOREPLACE)
2021-02-01 17:09:23 -05:00
Giuseppe Scrivano
450b0d790f
fuse-overlayfs: fix renameat2(RENAME_NOREPLACE)
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>
2021-02-01 23:00:50 +01:00
Daniel J Walsh
b104426786
Merge pull request #272 from giuseppe/check-whiteout-already-exists
main: check if whiteout device already exists
2021-01-25 13:48:21 -05:00
Giuseppe Scrivano
6f2af48a03
main: check if whiteout device already exists
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>
2021-01-25 19:00:15 +01:00
Daniel J Walsh
865b3b9dfb
Merge pull request #270 from giuseppe/tag-1.4
NEWS: tag 1.4.0
2021-01-22 08:37:43 -05:00
Giuseppe Scrivano
27bf038d0e
NEWS: tag 1.4.0
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
v1.4.0
2021-01-20 09:29:06 +01:00
Giuseppe Scrivano
3ae5b85c5b
main: fix compiler warning
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-01-20 09:29:05 +01:00
Daniel J Walsh
bfe6d5e789
Merge pull request #268 from giuseppe/squash-to-id
main: add squash_to_uid and squash_to_gid
2021-01-05 14:05:08 -05:00
Giuseppe Scrivano
0b551b90bd
man: document squash functionalities
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-12-22 15:58:11 +01:00
Giuseppe Scrivano
e5d35c9a01
main: add squash_to_uid and squash_to_gid
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-12-22 15:57:56 +01:00
Daniel J Walsh
bccc81eb8e
Merge pull request #267 from giuseppe/github-actions-ci
tests: move to github actions instead of travis
2020-12-21 13:48:03 -05:00
Giuseppe Scrivano
fa1dc2cf53
test: use github actions for CI
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-12-21 18:39:30 +01:00
Giuseppe Scrivano
43a1faf889
.travis.yml: remove file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-12-21 17:44:58 +01:00
Giuseppe Scrivano
abf77369b3
tests: upgrade to centos:8
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-12-21 17:44:49 +01:00
Giuseppe Scrivano
53f598afea
tests: drop -ti
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-12-21 17:04:29 +01:00
Daniel J Walsh
3a1301ec2d
Merge pull request #264 from giuseppe/tag-1.3
NEWS: tag 1.3
2020-11-25 09:26:20 -05:00
Giuseppe Scrivano
18f574f192
NEWS: tag 1.3
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
v1.3.0
2020-11-25 14:42:50 +01:00
Daniel J Walsh
a9d8634e5f
Merge pull request #260 from giuseppe/invalidate-cache-readdir
main: invalidate directory cache on create/rename
2020-11-11 16:34:50 -05:00
Daniel J Walsh
84c224c6d1
Merge pull request #261 from giuseppe/fix-override
utils: enable override only for directories and files
2020-11-11 16:33:46 -05:00
Giuseppe Scrivano
33a2fa47c9
main: invalidate directory cache on create/rename
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>
2020-11-11 15:34:01 +01:00
Giuseppe Scrivano
7868e49da8
utils: enable override only for directories and files
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-11-11 11:18:41 +01:00
Daniel J Walsh
fc9de46ebf
Merge pull request #258 from giuseppe/block-set-containers-xattr
main: block setting the user.containers. xattr
2020-11-07 10:20:37 -05:00
Giuseppe Scrivano
a513d3de66
main: block setting the user.containers. xattr
it is reserved for internal usage with containers/storage.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-11-07 12:08:18 +01:00
Daniel J Walsh
15a04643b8
Merge pull request #257 from giuseppe/stat-override-containers
main: honor user.containers.override_stat
2020-11-06 11:35:01 -05:00
Giuseppe Scrivano
3cb30d4c11
main: honor user.containers.override_stat
also honor user.containers.override_stat to override containers stat
override as it is set by containers/storage.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-11-06 13:19:51 +01:00
Giuseppe Scrivano
3dbb7d9bd5
main: move stat override mode to enum
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-11-06 13:17:14 +01:00
Daniel J Walsh
d450ee1560
Merge pull request #256 from giuseppe/open-rm-files
main: open hidden files
2020-11-03 17:08:45 -05:00
Daniel J Walsh
61c9b1dd4a
Merge pull request #255 from giuseppe/fix-xattr-remapped
main: always remap ids when specified
2020-11-03 17:07:31 -05:00