Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FA_TOUCH'ed files getting removed on failed update #3393

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

pmatilai
Copy link
Member

@pmatilai pmatilai commented Oct 21, 2024

On install/update, most files are laid down with a temporary suffix and if the update fails, removing those at the end of the loop is the right thing to do. However FA_TOUCH'ed files were already there, we only update their metadata, and we better not remove them!

AFAICS this all versions since rpm >= 4.14 in one way or the other. If %_minimize_writes is enabled then it affects way more than just unmodified config files.

The test is a simplified version of pam update failing in the original report.

Fixes: RHEL-54386
Fixes: #3284

@pmatilai pmatilai requested a review from a team as a code owner October 21, 2024 08:11
@pmatilai pmatilai requested review from ffesti and removed request for a team October 21, 2024 08:11
@dmnks dmnks requested review from dmnks and removed request for ffesti October 21, 2024 08:13
On install/update, most files are laid down with a temporary suffix
and if the update fails, removing those at the end of the loop is
the right thing to do. However FA_TOUCH'ed files were already there,
we only update their metadata, and we better not remove them!

AFAICS this all versions since rpm >= 4.14 in one way or the other.
If %_minimize_writes is enabled then it affects way more than just
unmodified config files.

The test is a simplified version of pam update failing in the original
report. Technically, --nomtime should not be needed for the test
verification but we don't even try to restore the metadata on failure,
and fixing that is way out of scope here.

Fixes: RHEL-54386
Fixes: rpm-software-management#3284
Copy link
Contributor

@dmnks dmnks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dmnks dmnks merged commit 027ef64 into rpm-software-management:master Oct 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unpack failure on update can cause unmodified %config files to be erased
2 participants