Repository navigation
fix: don't wedge deployment finalization on SELinux policy refresh - #3649
HuntedRaven7 wants to merge 6 commits into
Conversation
…ilures The /etc merge can carry stale or incomplete libsemanage state into new deployments (e.g. leftover tmp/ transaction directories from an interrupted image build, or orphaned policy modules), after which every semodule run fails and ostree-finalize-staged permanently wedges all updates until the module store is repaired manually. Prune stale tmp/ transaction state under each policy store before running semodule, and treat refresh failures as non-fatal: log loudly to the journal and stderr, then finalize the deployment with the previously built binary policy carried over via /etc. Closes ostreedev#3563
|
strange the clang stuff fails but the files I changed pass. |
|
Another case this fixes: an image with only a compiled SELinux policy and no libsemanage module store. It's common on embedded builds (Yocto refpolicy here), where local policy modules are never wanted. For now we carry a small patch in One thing for the dry-run-at-stage idea in #3563: without a store, a dry run fails as well, so those images would refuse every update. Whichever way this goes, skipping the refresh when there's no store keeps them working. Happy to send that check as its own PR if it's wanted. |
- Use glnx_file_get_contents_utf8_at() correctly (it returns the contents and takes out_len as its third argument). - Replace g_auto(GString)/G_STRING_INIT with g_autoptr(GString) and g_string_new(), which is available with the project's minimum GLib. - Drop the unused new_upstream_exists variable, and handle files that are gone from the new policy store so the cleanup actually works. - Reformat the clang-format-only changes with clang-format 18, the version used by CI.
The /etc merge can carry stale or incomplete libsemanage state into new deployments (e.g. leftover tmp/ transaction directories from an interrupted image build, or orphaned policy modules), after which every semodule run fails and ostree-finalize-staged permanently wedges all updates until the module store is repaired manually.
Prune stale tmp/ transaction state under each policy store before running semodule, and treat refresh failures as non-fatal: log loudly to the journal and stderr, then finalize the deployment with the previously built binary policy carried over via /etc.
Closes #3563