Skip to content

Commit d97c7a2

Browse files
authored
Merge pull request #5620 from jmarrero/avc-denial
composepost: Add subs_dist equivalency for /var/lib/selinux
2 parents d5ef5f0 + 2fd61d7 commit d97c7a2

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

packaging/Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Build RPMs for rpm-ostree
22
# This containerfile builds RPMs in a containerized environment.
33

4-
ARG base=quay.io/fedora/fedora-bootc:42
4+
ARG base=quay.io/fedora/fedora-bootc:44
55

66
FROM scratch as src
77
# For RPM builds, we need the git repository

rust/src/composepost.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,14 @@ fn postprocess_subs_dist(rootfs_dfd: &Dir) -> Result<()> {
419419
}
420420
writeln!(w, "# https://github.com/coreos/rpm-ostree/pull/1795")?;
421421
writeln!(w, "/usr/lib/opt /opt")?;
422+
// The SELinux policy store is moved from /var/lib/selinux to
423+
// /etc/selinux (see postprocess_selinux_policy_store_location),
424+
// and a compatibility symlink is created via tmpfiles.d. Add an
425+
// equivalency rule so that label lookups through the old path
426+
// resolve correctly.
427+
// https://github.com/coreos/rpm-ostree/issues/5616
428+
writeln!(w, "# https://github.com/coreos/rpm-ostree/issues/5616")?;
429+
writeln!(w, "/var/lib/selinux /etc/selinux")?;
422430
Ok(())
423431
})?;
424432
}

tests/compose.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if [ ! -d compose-cache ]; then
5050
# default; we'll want it to test `install-langs`. This also means that we have
5151
# to add updates-archive to the repo list.
5252
# Also neuter OSTree layers; we don't re-implement cosa's auto-layering sugar
53-
curl -Lf --retry 3 -O https://src.fedoraproject.org/rpms/fedora-repos/raw/f42/f/fedora-updates-archive.repo
53+
curl -Lf --retry 3 -O https://src.fedoraproject.org/rpms/fedora-repos/raw/f44/f/fedora-updates-archive.repo
5454
python3 -c '
5555
import sys, json
5656
y = json.load(sys.stdin)

tests/compose/libbasic-test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ ostree --repo=${repo} cat ${treeref} \
3838
/usr/etc/selinux/targeted/contexts/files/file_contexts.subs_dist > subs_dist.txt
3939
assert_not_file_has_content subs_dist.txt '^/var/home \+'
4040
assert_file_has_content subs_dist.txt '^/home \+/var/home$'
41+
# https://github.com/coreos/rpm-ostree/issues/5616
42+
assert_file_has_content subs_dist.txt '^/var/lib/selinux \+/etc/selinux$'
4143
echo "ok etc/default/useradd"
4244

4345
for path in /usr/share/rpm /usr/lib/sysimage/rpm-ostree-base-db; do

0 commit comments

Comments
 (0)