768 Commits

Author SHA1 Message Date
Giuseppe Scrivano
50787d3827
main: prepare wrappers for chown/chmod
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-08-21 16:43:59 +02:00
Giuseppe Scrivano
ab407f7c9e
direct: store if the layer must be remapped
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-08-21 16:02:59 +02:00
Giuseppe Scrivano
519ce4df6f
Merge pull request #228 from giuseppe/override-file-mode-and-owner
fuse-overlays: introduce xattr to override gid/uid/mode
2020-08-21 10:39:59 +02:00
Giuseppe Scrivano
63abdc1138
fuse-overlays: introduce xattr to override gid/uid/mode
introduce a new xattr "user.fuseoverlayfs.override_stat" that permit
to override the reported uid/gid/mode for lower layers.

It enables sharing storage among different users.

Since it is not possible to use "user.*" xattrs for symlinks, provide
also a privileged variant "security.fuseoverlayfs.override_stat", so
the root user can create the xattr for symlinks as well.

A script "fix-mode.py" is provided for converting an existing
layer/storage to the new model.  It is a destructive operation as
every file is converted to mode 0755, thus it is not usable anymore
with native overlay, or older versions of fuse-overlayfs.

Example with Podman:

Rootless:
Modify /.config/containers/storage.conf and add under storage.options:
additionalimagestores = ["/var/lib/shared-storage"]

Assuming an empty local storage for the user:

$ podman images
REPOSITORY                TAG     IMAGE ID      CREATED      SIZE    ReadOnly
docker.io/library/fedora  latest  a368cbcfa678  5 weeks ago  189 MB  true

and the files show the original mode and owner:

$ podman run --read-only --rm -ti docker.io/library/fedora ls -l /
lrwxrwxrwx.   1 root   root      7 Jan 28  2020 bin -> usr/bin
dr-xr-xr-x.   2 root   root      6 Jan 28  2020 boot
drwxr-xr-x.   5 root   root    360 Aug 15 13:26 dev
drwxr-xr-x.  41 root   root   4096 Jul  9 06:48 etc
drwxr-xr-x.   2 root   root      6 Jan 28  2020 home
lrwxrwxrwx.   1 root   root      7 Jan 28  2020 lib -> usr/lib
lrwxrwxrwx.   1 root   root      9 Jan 28  2020 lib64 -> usr/lib64
drwx------.   2 root   root      6 Jul  9 06:48 lost+found
drwxr-xr-x.   2 root   root      6 Jan 28  2020 media
drwxr-xr-x.   2 root   root      6 Jan 28  2020 mnt
drwxr-xr-x.   2 root   root      6 Jan 28  2020 opt
dr-xr-xr-x. 436 nobody nobody    0 Aug 15 13:26 proc
dr-xr-x---.   2 root   root    196 Jul  9 06:48 root
drwxrwxrwt.   3 root   root     80 Aug 15 13:26 run
lrwxrwxrwx.   1 root   root      8 Jan 28  2020 sbin -> usr/sbin
drwxr-xr-x.   2 root   root      6 Jan 28  2020 srv
dr-xr-xr-x.  13 nobody nobody    0 Aug  5 21:38 sys
drwxrwxrwt.   2 root   root     60 Aug 15 13:26 tmp
drwxr-xr-x.  12 root   root    144 Jul  9 06:48 usr
drwxr-xr-x.  18 root   root    235 Jul  9 06:48 var

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-08-17 14:01:17 +02:00
Giuseppe Scrivano
800011be8f
Merge pull request #226 from giuseppe/fix-segfault
main: fix segfault if no mountpoint specified
2020-07-20 08:46:12 +02:00
Giuseppe Scrivano
8f666d4820
main: fix segfault if no mountpoint specified
Closes: https://github.com/containers/fuse-overlayfs/issues/225

Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2020-07-17 23:39:03 +02:00
Daniel J Walsh
fb8b3e03ca
Merge pull request #223 from giuseppe/tag-1.1.2
NEWS: tag 1.1.2
2020-06-29 08:29:44 -04:00
Giuseppe Scrivano
323b01f174
NEWS: tag 1.1.2
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
v1.1.2
2020-06-29 13:54:43 +02:00
Giuseppe Scrivano
2b8dff330f
main: fix memory leak when creating a whiteout
Closes: https://github.com/containers/fuse-overlayfs/issues/222

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-29 13:54:22 +02:00
Daniel J Walsh
87a850d616
Merge pull request #219 from asafkahlon/fix-build-on-musl
direct.c: fix compilation with musl
2020-06-22 14:58:14 -04:00
Asaf Kahlon
27a01e622e direct.c: fix compilation with musl
Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
2020-06-22 20:48:36 +03:00
Daniel J Walsh
50ab2c272c
Merge pull request #218 from ffontaine/master
utils.c: fix build on uclibc
2020-06-22 12:30:53 -04:00
Fabrice Fontaine
321fa87d7e utils.c: fix build on uclibc
Neither uClibc nor uClibc-ng support O_TMPFILE. Define it in utils.c if
not defined.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-06-21 19:16:58 +02:00
Giuseppe Scrivano
a7dd94374b
Merge pull request #217 from giuseppe/add-error-checks
main: fix lookup for overflow uid
v1.1.1
2020-06-20 21:14:45 +02:00
Giuseppe Scrivano
94ee6dce22
NEWS: tag v1.1.1
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-20 21:13:59 +02:00
Giuseppe Scrivano
1d8f4b529d
main: fix lookup for overflow uid
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>
2020-06-20 20:34:28 +02:00
Giuseppe Scrivano
0d985794d9
main: add error checks for workdir initialization
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-20 20:33:52 +02:00
Giuseppe Scrivano
b4203383fd
Merge pull request #216 from AkihiroSuda/cross
CI: Upload static release binaries
2020-06-20 12:02:12 +02:00
Akihiro Suda
0bfca81c39
CI: Upload static release binaries
Based on 99e1516d2b/.github/workflows/release.yaml

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-06-19 13:03:18 +09:00
Giuseppe Scrivano
74bbaf59df
Merge pull request #215 from giuseppe/fix-typo-NEWS
NEWS: fix typo
2020-06-18 09:16:01 +02:00
Giuseppe Scrivano
116d326fff
NEWS: fix typo
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
v1.1.0
2020-06-18 09:15:04 +02:00
Daniel J Walsh
8b4062db5c
Merge pull request #214 from giuseppe/mkdir-fix
mkdir: if the destination exists atomically swap them
2020-06-17 16:59:33 -04:00
Giuseppe Scrivano
d68235ff9b
configure.ac: tag 1.1.0
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-17 15:57:40 +02:00
Giuseppe Scrivano
f26f1f71ae
mkdir: if the destination exists atomically swap them
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>
2020-06-17 15:05:00 +02:00
Daniel J Walsh
f3e4154078
Merge pull request #212 from giuseppe/fix-check-set-xattr
main: correctly report copyup error
2020-05-26 16:43:41 -04:00
Giuseppe Scrivano
6d75146e29
main: correctly report copyup error
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>
2020-05-26 22:20:15 +02:00
Giuseppe Scrivano
222c3a1901
Merge pull request #208 from TomSweeneyRedHat/sec
Add Security Policy
2020-05-11 16:08:29 +02:00
TomSweeneyRedHat
66c1e296e2 Add Security Policy
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-05-09 15:14:50 -04:00
Daniel J Walsh
d2c9645000
Merge pull request #207 from giuseppe/static-analysis
fuse-overlayfs: fix different issues reported by static analysis
2020-05-04 08:02:22 -04:00
Giuseppe Scrivano
77a4493db5
travis: run tests sequentially
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-30 15:19:02 +02:00
Giuseppe Scrivano
f6262ed778
main: fix copy loop
fix potential infinite loop on a short read.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-30 15:13:32 +02:00
Giuseppe Scrivano
9b687001bb
main: fix signature for ovl_ioctl
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-30 15:13:31 +02:00
Giuseppe Scrivano
cb934ef871
main: delete dead code
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-30 15:13:30 +02:00
Giuseppe Scrivano
b947555f87
main: remove superflous check
pnode cannot be NULL.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-30 15:13:30 +02:00
Giuseppe Scrivano
33a3a7970e
main: avoid double free on cleanup
the cleanup_node_init label already takes care of it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-30 15:13:29 +02:00
Giuseppe Scrivano
83ae5cc252
tests/unlink.sh: make sure directories are empty
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-30 15:13:28 +02:00
Daniel J Walsh
60167adad7
Merge pull request #205 from giuseppe/fix-symlink-mtime
main: fix set mtime for a symlink
2020-04-28 16:34:46 -04:00
Giuseppe Scrivano
5b271aa796
main: add check for malloc
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2020-04-25 13:43:00 +02:00
Giuseppe Scrivano
26e4226a41
main: fix set mtime for a symlink
Closes: https://github.com/containers/fuse-overlayfs/issues/204

Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2020-04-25 13:28:33 +02:00
Daniel J Walsh
e70b270460
Merge pull request #203 from giuseppe/use-openat2
main: use openat2 where available
2020-04-22 08:52:24 -04:00
Giuseppe Scrivano
e7051f874b
.travis.yml: use latest fuse release
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-22 09:11:28 +02:00
Giuseppe Scrivano
fb8eb3300e
main: use openat2 where available
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-21 18:33:33 +02:00
Daniel J Walsh
f040ab0343
Merge pull request #202 from giuseppe/accept-ro
main.c: accept "ro" as a mount option
2020-04-20 06:43:24 -04:00
Giuseppe Scrivano
dd985bccba
main.c: accept "ro" as a mount option
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-20 12:28:53 +02:00
Giuseppe Scrivano
4f1d0cdd02
Merge pull request #201 from eamsden/eamsden/fix-cross-compile
Fix cross compilation
2020-04-18 13:10:02 +02:00
Daniel J Walsh
ad7e6cdfa2
Merge pull request #200 from giuseppe/tag-1.0
fuse-overlays: release 1.0.0
2020-04-18 06:14:34 -04:00
Edward Amsden
f7f103a538
Fix cross compilation 2020-04-17 11:50:58 -04:00
Giuseppe Scrivano
561d0287dc
fuse-overlays: release 1.0.0
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
v1.0.0
2020-04-17 11:10:44 +02:00
Daniel J Walsh
1a5b202866
Merge pull request #199 from giuseppe/fix-armv7h
fuse-overlayfs: add missing definitions for _FILE_OFFSET_BITS
2020-04-15 07:15:07 -04:00
Giuseppe Scrivano
7c0629a3a5
travis.yml: fix build
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-15 12:36:26 +02:00