798 Commits

Author SHA1 Message Date
Giuseppe Scrivano
2772fa30c7
Merge pull request #446 from giuseppe/tag-1.15
release 1.15
2025-05-08 13:34:23 +02:00
Giuseppe Scrivano
0ea1677326
configure.ac: prepare new release cycle
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-05-08 08:36:11 +02:00
Giuseppe Scrivano
c5f3ef142e
NEWS: tag 1.15
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
v1.15
2025-05-08 08:36:11 +02:00
Giuseppe Scrivano
e8532dce73
Merge pull request #445 from giuseppe/fix-lookup-lower-layers-of-freshly-created-dir
main: lookup upperdir only for created directories
2025-05-07 17:01:02 +02:00
Giuseppe Scrivano
6a1040f01d
main: lookup upperdir only for created directories
always stop looking up at the upper layer for newly created
directories so to not expose the lower directory content.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-05-07 11:56:22 +02:00
Giuseppe Scrivano
d5b2cec0e7
main: fix layer lookup in make_ovl_node
Stop iterating through layers in `make_ovl_node`
if the current layer being checked is the `last_layer`
of the parent node.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-05-07 11:44:28 +02:00
Giuseppe Scrivano
28ba1fd247
Merge pull request #443 from giuseppe/update-hash-map-module
main: use hash_remove instead of hash_delete
2025-04-30 08:52:47 +02:00
Giuseppe Scrivano
b88a093bd4
main: use hash_remove instead of hash_delete
the function is deprecated in gnulib

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-04-29 23:41:30 +02:00
Giuseppe Scrivano
ce8d185c16
lib: update hash module from gnulib
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-04-29 23:34:01 +02:00
Giuseppe Scrivano
3af99f6552
Merge pull request #441 from giuseppe/unescape-dirs
main: Allow escaped colons in directory paths
2025-04-29 22:28:08 +02:00
Giuseppe Scrivano
27cabd561b
main: Allow escaped colons in directory paths
Allow directory paths specified for lowerdir, upperdir and workdir to
contain colon characters.

Previously, colons were unconditionally treated as separators,
making it impossible to use directories with colons in their names.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-04-28 18:46:30 +02:00
Giuseppe Scrivano
b31d82ff8e
main: use parsed upper layer directory
Use the directory in the loaded layer structure, and do not use the
value passed on the CLI.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-04-28 18:46:30 +02:00
Giuseppe Scrivano
02a3582501
refactor: Remove unnecessary upperdir realpath
The explicit resolution of the upper directory path using `realpath()`
is not required before passing it to `read_dirs` since
`direct_load_data_source()` already does it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-04-28 18:46:30 +02:00
Giuseppe Scrivano
5e7f7d756e
github: update checkout action
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-04-28 18:46:30 +02:00
Giuseppe Scrivano
4761dd0675
github: update uraimo action
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-04-28 18:46:30 +02:00
Giuseppe Scrivano
fc6a2b916e
github: update upload-artifact action
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-04-28 18:46:30 +02:00
Giuseppe Scrivano
e1aae5aa6b
github: enable unprivileged user namespaces
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-04-28 18:46:30 +02:00
Giuseppe Scrivano
6df9cd27c7
Merge pull request #439 from alvistack/AC_INIT-1.15-dev
Update AC_INIT to 1.15-dev
2025-04-28 12:29:34 +02:00
Wong Hoi Sing Edison
efb61490c3
Update AC_INIT to 1.15-dev
The version string should update as "1.14" when we have stable release:

    -AC_INIT([fuse-overlayfs], [1.13-dev], [giuseppe@scrivano.org])
    +AC_INIT([fuse-overlayfs], [1.14], [giuseppe@scrivano.org])

But since we had already get
https://github.com/containers/fuse-overlayfs/releases/tag/v1.14 since
2024-06-28, here we bump the version string to "1.15-dev" for next
stable release.

Fixes https://github.com/containers/fuse-overlayfs/issues/438

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2025-03-26 11:56:57 +08:00
Daniel J Walsh
a54a9f2e88
Merge pull request #434 from giuseppe/use-extended-override-xattr
main: use extended override xattr
2024-12-02 10:09:47 -05:00
Giuseppe Scrivano
6bbd62bb13
main: use extended override xattr
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-12-02 09:52:35 +01:00
Giuseppe Scrivano
8d33894c48
github: update run-on-arch-action
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-12-02 09:52:35 +01:00
Giuseppe Scrivano
cf8269b5f6
github: update ubuntu version
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-12-02 09:52:35 +01:00
Giuseppe Scrivano
af77bb6584
tests: bump fedora version
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-12-02 09:52:35 +01:00
Giuseppe Scrivano
ab0b0f6d46
Merge pull request #430 from hholst80/main
Remove unsupported option "lazytime"
2024-08-18 02:33:09 +02:00
Henrik Holst
e107b0bfe4 Remove unsupported option "lazytime"
Signed-off-by: Henrik Holst <6200749+hholst80@users.noreply.github.com>
2024-08-17 11:41:49 +02:00
Daniel J Walsh
147609b1fb
Merge pull request #426 from giuseppe/tag-1.14
NEWS: tag 1.14
2024-06-27 13:48:23 -04:00
Giuseppe Scrivano
33cb788edc
NEWS: tag 1.14
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
v1.14
2024-06-27 15:45:18 +02:00
Giuseppe Scrivano
4217e1c160
Merge pull request #422 from akihikodaki/containers
Prefer user.containers.override_stat over user.fuseoverlayfs.
2024-06-17 20:33:21 +02:00
Akihiko Odaki
20161f96d7 main: Isolate security xattrs for STAT_OVERRIDE_CONTAINERS
The major use case of stat override is to enable rootless containers
on network filesystems, and they also lack security xattr support in
non-root user namespaces. Trying to set security xattrs on them result
in ENOTSUP and break things.

It makes little sense to share security xattrs with the underlying
filesystems when overriding stat in the first place. Linux's NFS server
exposes security xattrs only when the user explicitly claims the
security consistencies between the server and clients, and hide them
otherwise. Following this precedent, we should isolate security xattrs
since we know the security policy enforced by fuse-overlayfs is already
distinct from the underlying filesystem when overriding owners and file
mode.

Mark security xattrs inaccessible with STAT_OVERRIDE_CONTAINERS to
prefix all access to them with XATTR_CONTAINERS_OVERRIDE_PREFIX.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2024-06-17 22:50:14 +09:00
Akihiko Odaki
9810b85aad main: Override inaccessible xattrs
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2024-06-17 22:50:14 +09:00
Akihiko Odaki
90bea22c73 Prefer user.containers.override_stat over user.fuseoverlayfs.
Previously, fuse-overlayfs always used user.fuseoverlayfs.override_stat
for the upper layer while honoring user.containers.override_stat for
lower layers so that it can consume a layer created by
containers/storage.

It turned out that containers/storage also needs to get the overriding
extended attribute set by fuse-overlayfs and to set one for the upper
layer to make the root directory of the upper layer inherit the mode
of a lower layer. Adding code to get and to set
user.fuseoverlayfs.override_stat to containers/storage is a bit ugly.

The underlying problem is that fuse-overlayfs changes what name to use
ad hoc. Fix it by always preferring user.containers.override_stat, which
containers/storage honors, over user.fuseoverlayfs.overlayfs, which is
specific to fuse-overlayfs.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2024-06-17 22:50:14 +09:00
Akihiko Odaki
e16818c042 Fix printed extended attribute name
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2024-06-17 22:50:14 +09:00
Akihiko Odaki
9610adf7ab main: Do not set -1 for owner overriding xattrs
ovl_setattr () used to pass -1 as uid or gid when either of them
is not changed for do_fchown () / do_chown (), but if these functions
use overriding xattrs instead of real fchown () or chown (), it causes
-1 to be written in owner overriding xattrs and break them.

Replace -1 with the current uid or gid before calling do_fchown () /
do_chown ().

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2024-06-17 22:50:01 +09:00
Akihiko Odaki
136aefd2f6 main: Fix file owner retrieval for chmod
do_fchmod () and do_chmod () used to call override_mode () directly to
retrieve the owner information, but the usage of override_mode () was
wrong; override_mode () expects struct stat is already populated by
the information provided by the underlying filesystem, but do_fchmod ()
and do_chmod () only zeroed st_uid and st_gid. override_mode () does not
update the owner information when st_mode is not S_IFDIR nor S_IFREG so
this caused chmod to change the file owner to root at random.

Use the logic rpl_stat () employs to file owner retrieval for chmod
functions to ensure they provide the owner information consistent with
rpl_stat ().

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2024-06-17 21:35:51 +09:00
Akihiko Odaki
a13a9e71dc utils: Always suppress ENODATA
override_mode () used to suppress ENODATA only in a certain condition.
ENODATA errors in other situations made load_dir () fail because it
indirectly calls override_mode () when the underlying file system
reports DT_UNKNOWN for an opaque whiteout file and such an file does
not have mode xattrs. do_fchmod () and do_chmod () worked around the
problem by supressing ENODATA by themselves, but that led to code
duplication. Always suppress ENODATA to resolve these problems.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2024-06-17 21:35:51 +09:00
Akihiko Odaki
b644635d67 tests: Update to Ubuntu 22.04
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2024-06-17 21:35:39 +09:00
Akihiko Odaki
19ba462b57 tests: Update run-on-arch-action to v2.7.2
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2024-06-17 21:34:11 +09:00
Giuseppe Scrivano
25505d9b6c
Merge pull request #424 from akihikodaki/tests
Fix tests
2024-06-17 14:03:29 +02:00
Akihiko Odaki
d34257cd3a build: Fix libfuse version
Building the current master branch fails with:
#8 4.712 ninja: job failed: cc -Ilib/libfuse3.a.p -Ilib -I../lib -Iinclude -I../include -I. -I.. -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_REENTRANT -DHAVE_LIBFUSE_PRIVATE_CONFIG_H -Wno-sign-compare -D_FILE_OFFSET_BITS=64 -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings -fno-strict-aliasing -Wno-unused-result -DHAVE_SYMVER_ATTRIBUTE -fPIC -pthread -DFUSE_USE_VERSION=317 '-DFUSERMOUNT_DIR="/usr/bin"' -MD -MQ lib/libfuse3.a.p/fuse_signals.c.o -MF lib/libfuse3.a.p/fuse_signals.c.o.d -o lib/libfuse3.a.p/fuse_signals.c.o -c ../lib/fuse_signals.c
#8 4.713 ../lib/fuse_signals.c:19:10: fatal error: execinfo.h: No such file or directory
#8 4.713    19 | #include <execinfo.h>
#8 4.713       |          ^~~~~~~~~~~~
#8 4.713 compilation terminated.
#8 13.65 ninja: subcommand failed

Use the latest stable version, which is 3.16.2

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2024-06-17 18:01:59 +09:00
Akihiko Odaki
da0f9cb03b tests: Use Fedora to test fast_ino_check
The test of fast_ino_check used CentOS Stream 8, which is no longer
supported and whose repositories are no longer available.

While we can update it to use CentOS Stream 9, use Fedora instead for
consistency with the other test cases.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2024-06-17 17:51:50 +09:00
Akihiko Odaki
3a1b242526 tests: Drop the test case for https://github.com/containers/fuse-overlayfs/issues/86
The test case for https://github.com/containers/fuse-overlayfs/issues/86
does no longer work because it relies on CentOS Stream 8 repositories,
which are unavailable.

While we can update it to use CentOS Stream 9, the issue says it is
limited to CentOS 6, and it is unclear if the test case will reproduce
the intended scenario with CentOS Stream 8 or 9 so drop it.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2024-06-17 17:49:20 +09:00
Giuseppe Scrivano
a01f52fc6b
Merge pull request #415 from flouthoc/fix-clang-errors
.clang-format: remove duplicated mapping key which breaks newer `clang` formatters.
2024-02-21 09:35:54 +01:00
flouthoc
ebc3b5c9f8
.clang-format: fix duplicated mapping key
New clang versions throw error like, following commit fixes that

```console
.clang-format:26:1: error: duplicated mapping key 'AllowShortIfStatementsOnASingleLine'
AllowShortIfStatementsOnASingleLine: false
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2024-02-20 22:16:16 -08:00
Giuseppe Scrivano
c2dd76c6d7
Merge pull request #412 from giuseppe/fix-variable-leak
main: automatically cleanup newpath
2024-02-06 13:21:34 +01:00
Giuseppe Scrivano
c08211ddd7
main: automatically cleanup newpath
this was already the assumption in the source code.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-02-06 10:21:52 +01:00
Giuseppe Scrivano
18f4d6768a
Merge pull request #410 from giuseppe/propagate-force-mask-on-dir-copyup
main: propagate xattrs permissions with copyup
2023-11-03 10:36:21 +01:00
Giuseppe Scrivano
d9e78eadb7
main: create dir in two steps with xattrs permissions
if xattrs permissions are used, create the directory in two steps and
set the correct ownership before moving it into the target.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-11-02 11:49:16 +01:00
Giuseppe Scrivano
d65ce2a8bb
main: propagate xattrs permissions with copyup
when a directory is copied up, propagate its mode if using xattrs
permissions.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-11-01 21:35:03 +01:00
Giuseppe Scrivano
906513ccba
Merge pull request #409 from giuseppe/create-inodes-with-correct-mode
Create devices and dirs with correct mode with xattrs_permissions
2023-10-31 08:54:38 +01:00