559 Commits

Author SHA1 Message Date
Shotaro Gotanda
e6012da12f main: fix typo
Signed-off-by: Shotaro Gotanda <g.sho1500@gmail.com>
2020-10-21 05:27:45 +09:00
Giuseppe Scrivano
428bc7bdec
Merge pull request #248 from progrunner17/patch-1
fix errno
2020-10-20 19:27:31 +02:00
Shotaro Gotanda
6043ce7ddb main: fix fuse_reply_error to use errno on malloc failure
fuse_reply_error should receive errno instead of ENOMEM just after
malloc returned NULL.

Signed-off-by: Shotaro Gotanda <g.sho1500@gmail.com>
2020-10-21 00:30:23 +09:00
Shotaro Gotanda
df46733cf8 main: fix fuse_reply_error to use ENOMEM on calloc failure
fuse_reply_error should receive ENOMEM instead of ENOENT.

Signed-off-by: Shotaro Gotanda <g.sho1500@gmail.com>
2020-10-21 00:25:57 +09:00
Daniel J Walsh
54da2c0cf4
Merge pull request #249 from progrunner17/patch-2
fix typo of debug output of lo.gid_str
2020-10-20 10:02:57 -04:00
Daniel J Walsh
ce277b849d
Merge pull request #250 from AkihiroSuda/fix-configure-ac
configure.ac: set version to 1.2.0+dev
2020-10-20 09:59:41 -04:00
Akihiro Suda
10f379bcb7
configure.ac: set version to 1.2.0+dev
Relates to #224

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-10-20 15:41:08 +09:00
Shotaro Gotanda
65ea4595c4
fix typo 2020-10-20 06:41:44 +09:00
Daniel J Walsh
f009906072
Merge pull request #246 from giuseppe/create-inodes-0755
main: create inodes with 0755 with xattr_permissions
2020-10-10 07:16:29 -04:00
Giuseppe Scrivano
9c2575eede
Merge pull request #243 from plopresti/squash-to-root
Add squash_to_root mount option
2020-10-09 19:48:56 +02:00
Giuseppe Scrivano
9eb724ca15
main: create inodes with 0755 with xattr_permissions
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>
2020-10-09 16:33:14 +02:00
Giuseppe Scrivano
ba7314233d
Merge pull request #245 from giuseppe/install-go-md2man
build: check for go-md2man
2020-10-09 10:08:45 +02:00
Giuseppe Scrivano
2f54ffce73
build: check for go-md2man
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
v1.2.0
2020-10-09 09:51:22 +02:00
Giuseppe Scrivano
3548168535
Containerfile.cross: install go-md2man
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-09 09:39:46 +02:00
Patrick J. LoPresti
032877c501 Add squash_to_root mount option
(https://github.com/containers/fuse-overlayfs/issues/241).
2020-10-08 12:49:40 -07:00
Daniel J Walsh
0df6cf68f7
Merge pull request #242 from giuseppe/tag-1.2
NEWS: tag 1.2
2020-10-08 14:11:28 -04:00
Giuseppe Scrivano
edd565533d
NEWS: tag 1.2
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-08 17:50:15 +02:00
Daniel J Walsh
1760775f99
Merge pull request #240 from giuseppe/rename-dockerfiles
build: rename Dockerfile to Containerfile
2020-10-07 11:02:28 -04:00
Daniel J Walsh
3c4eb36f7b
Merge pull request #239 from giuseppe/leak-fix
main: fix a potential leak and be more aggressive on releasing inodes
2020-10-07 11:01:54 -04:00
Giuseppe Scrivano
a65b310508
build: rename Dockerfile to Containerfile
since these files need the -v option that is not present with Docker,
rename the files to Containerfile to avoid confusion.

more info: https://twitter.com/cpuguy83/status/1313523894536429568

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-06 19:22:49 +02:00
Giuseppe Scrivano
da71779dd9
fuse-overlayfs.1: regenerate
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-06 18:31:14 +02:00
Giuseppe Scrivano
0e33eb5da8
main: drop the ino if the last node is removed
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-06 17:47:36 +02:00
Giuseppe Scrivano
228544e71d
main: remove unreferenced inodes on forget_multi
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-06 17:47:35 +02:00
Giuseppe Scrivano
6e2675593c
main: attempt an inode free on releasedir
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>
2020-10-06 17:47:34 +02:00
Giuseppe Scrivano
e9cdbc444c
main: print usage statistics on USR1
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-06 11:10:33 +02:00
Giuseppe Scrivano
540f80dbe8
main: record how many objects are in memory
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-06 11:10:33 +02:00
Daniel J Walsh
04ed72d155
Merge pull request #237 from giuseppe/check-ENAMETOOLONG
main: prevent ENAMETOOLONG for whiteout files
2020-10-05 08:01:53 -04:00
Giuseppe Scrivano
573cfac0a6
main: prevent creating files longer than f_namemax
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-04 20:30:02 +02:00
Giuseppe Scrivano
4725e0ba66
main: reserve sfs.f_namemax for whiteout prefix
redure the reported sfs.f_namemax by the maximum length that can be
added for whiteout files.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-04 16:45:07 +02:00
Giuseppe Scrivano
d34833dfb3
main: skip ENAMETOOLONG for whiteouts lookup
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>
2020-10-04 16:41:42 +02:00
Giuseppe Scrivano
421c64db78
Merge pull request #235 from rhatdan/codespell
Fix problems found by codespell
2020-09-12 17:43:59 +02:00
Daniel J Walsh
cb6b7d55bc
Fix problems found by codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-11 10:29:03 -04:00
Giuseppe Scrivano
0097950819
Merge pull request #234 from giuseppe/fix-regression-symlink
main: honor chownat flags
2020-09-07 22:15:30 +02:00
Giuseppe Scrivano
b1cc0e2b98
main: honor chownat flags
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>
2020-09-03 22:25:02 +02:00
Giuseppe Scrivano
b958a3062e
Merge pull request #230 from mgoltzsche/fix_alpine_file_exists_at
utils.c: fix file_exists_at on musl.
2020-08-27 09:43:56 +02:00
Max Goltzsche
d5b725b6f1
utils.c: fix file_exists_at musl compatibility.
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>
2020-08-26 02:22:53 +02:00
Daniel J Walsh
2608feec4f
Merge pull request #231 from giuseppe/update-travis
travis: update to focal
2020-08-25 15:21:44 -04:00
Giuseppe Scrivano
ab5bcc38c3
travis: update to focal
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-08-25 15:10:19 +02:00
Daniel J Walsh
938d9d4b1f
Merge pull request #229 from giuseppe/remap-writeable
main: support writing uid/gid/mode to xattr
2020-08-25 09:00:56 -04:00
Giuseppe Scrivano
b8086b58fa
main: support writing uid/gid/mode to xattr
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-08-21 19:52:28 +02:00
Giuseppe Scrivano
5c7fc2856a
direct: move override_mode to utils
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-08-21 16:52:26 +02:00
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