[Rpm-maint] [rpm-software-management/rpm] Honor alternate root in system user/group provides (PR #4095)

Michal Domonkos notifications at github.com
Thu Jan 22 12:14:14 UTC 2026


Commit 3617d160eb6a1a8a95689db5eb5648355ea60c2a missed the --root use case where it currently looks up users and groups on the host, which is of course wrong. This is because rpmtsCheck() (where this dependency check is done) happens well before we enter the target chroot.

Fix that by setting the chroot just before the rpmug calls and adapting those functions to take the chroot path into account when constructing the final passwd/group file paths.

Ideally, we would enter the chroot already in rpmtsCheck() but that would cause --test transactions to require root privileges, which might (and likely would) break some existing use cases out there, so let's leave that consideration for the future (if at all).

Note that this new logic, much like the existing one, is based on the assumption that the rpmug cache is flushed across chroots. However, this is currently the case only when setting a new chroot, not when entering or leaving one, which will be fixed separately via #4093.

Add a test to cover the --root use case with system provides, too.

Fixes: #4094
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/4095

-- Commit Summary --

  * Honor alternate root in system user/group provides

-- File Changes --

    M lib/depends.cc (4)
    M lib/rpmchroot.cc (6)
    M lib/rpmchroot.hh (7)
    M lib/rpmug.cc (3)
    M tests/rpmdeps.at (13)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/4095.patch
https://github.com/rpm-software-management/rpm/pull/4095.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4095
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/4095 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260122/78f22271/attachment.htm>


More information about the Rpm-maint mailing list