Skip to content

Commit

Permalink
Merge pull request #5225 from cgwalters/copy-bareuser-rpmdb
Browse files Browse the repository at this point in the history
libpriv/rpm: Always copy rpmdb even in user mode checkouts
  • Loading branch information
cgwalters authored Jan 16, 2025
2 parents d704b8b + 7832cd4 commit 2f470db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libpriv/rpmostree-rpm-util.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,11 @@ checkout_only_rpmdb (OstreeRepo *repo, const char *ref, const char *rpmdb, GLnxT
(OstreeRepoCheckoutMode)0,
};
checkout_options.mode = OSTREE_REPO_CHECKOUT_MODE_USER;
/* If the input repo is bare-user, then we'll just get hardlinks, which means
* that rpm interacting with it may end up *writing* to it (e.g. the sqlite shm files).
* Force a copy so that even if we're operating on bare-user we won't corrupt the repo.
*/
checkout_options.force_copy = TRUE;
const char *subpath = glnx_strjoina ("/", rpmdb);
checkout_options.subpath = subpath;
if (!ostree_repo_checkout_at (repo, &checkout_options, tmpdir->fd, RPMOSTREE_RPMDB_LOCATION,
Expand Down

0 comments on commit 2f470db

Please sign in to comment.