Repository navigation
Hotfix 4.3.1 - #116
Merged
Merged
Hotfix 4.3.1#116
Conversation
…es the version of the format * fix: chsr upgrade rewrote every file whose version was not the version of the package, even when no migration changed it: at each release, 4.3.1 included, the postinst of the package ran chsr upgrade, which failed through dosr (t_root, without CAP_LINUX_IMMUTABLE) and printed "run dosr chsr upgrade" for nothing; decided by the maintainer: the version of a file does not change when nothing else does * fix: a file that this version reads as it is (from UNCHANGED_SINCE, 4.1.0) is up to date: chsr upgrade and --check leave it with its version; an older one is migrated as before * feat: FORMAT_VERSION (4.3.0), the last version whose migration changes the documents, up or down: chsr writes it in a file that it saves and in the data that it creates, where it wrote its own version; the dosr of 4.3.0, which refuses a newer version, then reads a file saved by 4.3.1, a downgrade between them included * fix: chsr upgrade --check only reads the policy, and chsr upgrade reads it first and opens it for writing only when a file is to upgrade: both work on an up to date immutable policy without CAP_LINUX_IMMUTABLE, where chsr always opened it for writing and failed with "Operation not permitted" * fix: chsr upgrade --to the version that a file already has reports it, where it gave "its version is not known, or is already" as an error * chore: the report says "<file>: <its version>, up to date" and "upgraded from <version> to 4.3.0", the editor "migrated to 4.3.0" * tests: test_format_version: the migrations after FORMAT_VERSION change nothing both ways, a document of FORMAT_VERSION or of the current version is not migrated, new data is written for FORMAT_VERSION; 4.1.0 and 4.2.0 documents are read as they are; test_upgrade_access; test_upgrade_reads_an_up_to_date_policy_only: a 4.1.0 file that cannot be written is checked and upgraded through read-only settings and stays as it was, a 4.0.3 one is to upgrade, which fails on the former code; test_upgrade_to_an_older_version: once written for 4.1.0, the file is up to date and keeps 4.1.0; the tests that read PACKAGE_VERSION in a saved file read FORMAT_VERSION * tests: e2e.sh upgrade_without_cap_linux_immutable: under capsh --drop=cap_linux_immutable, chsr upgrade and --check succeed on the immutable policy, and fail with a 4.0.3 file planted Co-Authored-By: Claude
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #116 +/- ##
=======================================
Coverage 80.47% 80.47%
=======================================
Files 65 65
Lines 8547 8586 +39
=======================================
+ Hits 6878 6910 +32
- Misses 1669 1676 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.