mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-17 18:06:59 +02:00
Merge pull request #1502 from flatcar-linux/t-lo/fix-semodule-in-policycoreutils-postinst
sys-apps/policycoreutils: update correct SELinux store
This commit is contained in:
commit
cfc5fe67cc
@ -0,0 +1,10 @@
|
||||
The policycoreutils ebuild calls semodule in postinst to update SELinux stores.
|
||||
It does not, however, tells semodule the correct ROOT to use, so builds that go into /build/[arch]-usr end up updating the SDK's store.
|
||||
This patch resolves the following error message:
|
||||
```
|
||||
$ emerge-amd64-usr policycoreutils
|
||||
[...]
|
||||
libsemanage.semanage_commit_sandbox: Error while renaming /var/lib/selinux/targeted/active to /var/lib/selinux/targeted/previous. (Invalid cross-device link)
|
||||
```
|
||||
The error is observed when using the SDK Container to build an OS image.
|
||||
The `semanage` run in policycoreutilsi' `postinst` now also updates the correct store, which it previously did not.
|
@ -219,7 +219,7 @@ pkg_postinst() {
|
||||
for POLICY_TYPE in ${POLICY_TYPES} ; do
|
||||
# There have been some changes to the policy store, rebuilding now.
|
||||
# https://marc.info/?l=selinux&m=143757277819717&w=2
|
||||
einfo "Rebuilding store ${POLICY_TYPE} (without re-loading)."
|
||||
semodule -s "${POLICY_TYPE}" -n -B || die "Failed to rebuild policy store ${POLICY_TYPE}"
|
||||
einfo "Rebuilding store ${POLICY_TYPE} in '${ROOT:-/}' (without re-loading)."
|
||||
semodule -S "${ROOT:-/}" -s "${POLICY_TYPE}" -n -B || die "Failed to rebuild policy store ${POLICY_TYPE}"
|
||||
done
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user