[Rpm-maint] [rpm-software-management/rpm] Make user/group info reliable operation across chroot (PR #2503)

Panu Matilainen notifications at github.com
Fri May 5 10:45:18 UTC 2023


There's no telling what sort of caching getpwnam() and friends perform behind the scenes, and worse, there's no way to explicitly reset those caches. This can lead to chrooted operations using user/group data from the host, which is simply wrong.

Do our own parsing of /etc/passwd and /etc/group to fix. Besides the chroot matter, we then only ever lookup local system users and groups and not something from eg network name services. Technically we should track chroot status for each lookup and flush the cache if the state changed, but this is an internal API and rpm usages only ever call it from one side of the chroot for a given operation.

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

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

-- Commit Summary --

  * Make user/group info reliable operation across chroot

-- File Changes --

    M lib/rpmchroot.c (7)
    M lib/rpmug.c (135)
    M lib/rpmug.h (2)

-- Patch Links --

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

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

Message ID: <rpm-software-management/rpm/pull/2503 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230505/9871fbe4/attachment-0001.html>


More information about the Rpm-maint mailing list