mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
dbe7fff4765bad673d214c7e3db7bc088e163bea
Since acquiring user records involves plenty of IPC we try to cache user records in the PAM context between our various hooks. Previously we'd just cache whatever we acquired, and use it from the on, forever until the context is destroyed. This is problematic however, since some programs (notably sudo) use the same PAM context for multiple different operations. Specifically, sudo first authenticates the originating user before creating a session for the destination user, all with the same PAM context. Thankfully, there was a safety check for this case in place that re-validated that the cached user record actually matched our current idea of the user to operate on, but this just meant the hook would fail entirely. Let's rework this: let's key the cache by the user name, so that we do not confused by the changing of the user name during the context's lifecycle and always, strictly use the cached user record of the user we operate on. Essentially this just means we now include the user name in the PAM data field. Secondly, this gets rid of the extra PAM data field that indicates whether a user record is from homed or something else. To simplify things we instead just cache the user record twice: once for consumption by pam_systemd_home (which only wants homed records) and once shared by pam_systemd and pam_systemd_home (and whoever else wants it). The cache entries simply have different field names.
…
System and Service Manager
Details
General information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Stable branches with backported patches are available in the stable repo.
Description
Languages
C
89%
Python
5.1%
Shell
4.5%
Meson
1.2%
