Skip to content

Commit 4217e1c

Browse files
authored
Merge pull request #422 from akihikodaki/containers
Prefer user.containers.override_stat over user.fuseoverlayfs.
2 parents 25505d9 + 20161f9 commit 4217e1c

File tree

6 files changed

+210
-101
lines changed

6 files changed

+210
-101
lines changed

.github/workflows/test.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ on: [push, pull_request]
44

55
jobs:
66
build_job:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-22.04
88
name: Build on ${{ matrix.arch }}
99

1010
strategy:
1111
matrix:
1212
include:
1313
- arch: armv7
14-
distro: ubuntu20.04
14+
distro: ubuntu22.04
1515
- arch: aarch64
16-
distro: ubuntu20.04
16+
distro: ubuntu22.04
1717
- arch: s390x
18-
distro: ubuntu20.04
18+
distro: ubuntu22.04
1919
- arch: ppc64le
20-
distro: ubuntu20.04
20+
distro: ubuntu22.04
2121
steps:
2222
- uses: actions/checkout@v2.1.0
23-
- uses: uraimo/run-on-arch-action@v2.0.5
23+
- uses: uraimo/run-on-arch-action@v2.7.2
2424
name: Build
2525
id: build
2626
with:
@@ -34,7 +34,7 @@ jobs:
3434
3535
install: |
3636
apt-get update -q -y
37-
apt-get install -q -y attr automake autotools-dev git make gcc pkg-config xz-utils python3.8 g++ python3-setuptools libdevmapper-dev btrfs-progs libbtrfs-dev go-md2man parallel libfuse3-dev bats
37+
apt-get install -q -y attr automake autotools-dev git make gcc pkg-config xz-utils python3 g++ python3-setuptools libdevmapper-dev btrfs-progs libbtrfs-dev go-md2man parallel libfuse3-dev bats
3838
3939
run: |
4040
./autogen.sh
@@ -49,7 +49,7 @@ jobs:
4949
fuse-overlayfs
5050
5151
Test:
52-
runs-on: ubuntu-20.04
52+
runs-on: ubuntu-22.04
5353
strategy:
5454
fail-fast: false
5555
matrix:
@@ -66,7 +66,7 @@ jobs:
6666
- name: install dependencies
6767
run: |
6868
sudo apt-get update -q -y
69-
sudo apt-get install -q -y attr automake autotools-dev git make gcc pkg-config xz-utils python3.8 g++ python3-setuptools libdevmapper-dev btrfs-progs libbtrfs-dev go-md2man parallel wget libfuse3-dev bats
69+
sudo apt-get install -q -y attr automake autotools-dev git make gcc pkg-config xz-utils python3 g++ python3-setuptools libdevmapper-dev btrfs-progs libbtrfs-dev go-md2man parallel wget libfuse3-dev bats
7070
7171
sudo mkdir -p /lower /upper /mnt $GOPATH/src/github.com/containers
7272
sudo sh -c "cd $GOPATH/src/github.com/containers; git clone --depth=1 https://github.com/containers/storage"
@@ -90,7 +90,7 @@ jobs:
9090
- name: Archive build artifacts
9191
uses: actions/upload-artifact@v3
9292
with:
93-
name: fuse-overlayfs-x86_64-ubuntu20.04
93+
name: fuse-overlayfs-x86_64-ubuntu22.04
9494
path: |
9595
fuse-overlayfs
9696
if: ${{ matrix.test == 'ovl-whiteouts' }}

contrib/fix-mode.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
import errno
77

88
XATTR_OVERRIDE_STAT_PRIVILEGED = "security.fuseoverlayfs.override_stat"
9-
XATTR_OVERRIDE_STAT = "user.fuseoverlayfs.override_stat"
9+
XATTR_OVERRIDE_CONTAINERS_STAT = "user.fuseoverlayfs.override_stat"
1010

1111
if os.geteuid() == 0:
1212
xattr_name = XATTR_OVERRIDE_STAT_PRIVILEGED
1313
else:
14-
xattr_name = XATTR_OVERRIDE_STAT
14+
xattr_name = XATTR_OVERRIDE_CONTAINERS_STAT
1515

1616
cwd_fd = os.open(".", os.O_PATH)
1717

@@ -23,7 +23,7 @@ def fix_path(path):
2323
os.setxattr(path, xattr_name, str.encode(content), flags=os.XATTR_CREATE, follow_symlinks=False)
2424
except Exception as e:
2525
if e.errno == errno.EEXIST:
26-
print("attr %s already present for %s: %s" % (XATTR_OVERRIDE_STAT, path, e.errno))
26+
print("attr %s already present for %s: %s" % (xattr_name, path, e.errno))
2727
return
2828
raise e
2929

direct.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ direct_load_data_source (struct ovl_layer *l, const char *opaque, const char *pa
186186

187187
if (fgetxattr (l->fd, XATTR_PRIVILEGED_OVERRIDE_STAT, tmp, sizeof (tmp)) >= 0)
188188
l->stat_override_mode = STAT_OVERRIDE_PRIVILEGED;
189-
else if (fgetxattr (l->fd, XATTR_OVERRIDE_STAT, tmp, sizeof (tmp)) >= 0)
190-
l->stat_override_mode = STAT_OVERRIDE_USER;
191189
else if (fgetxattr (l->fd, XATTR_OVERRIDE_CONTAINERS_STAT, tmp, sizeof (tmp)) >= 0)
192190
l->stat_override_mode = STAT_OVERRIDE_CONTAINERS;
191+
else if (fgetxattr (l->fd, XATTR_OVERRIDE_STAT, tmp, sizeof (tmp)) >= 0)
192+
l->stat_override_mode = STAT_OVERRIDE_USER;
193193

194194
return 0;
195195
}

0 commit comments

Comments
 (0)