]> git.ipfire.org Git - thirdparty/systemd.git/commit
pam_systemd: split pam_sm_open_session() into more digestable blocks
authorLennart Poettering <lennart@poettering.net>
Fri, 15 Nov 2024 13:25:59 +0000 (14:25 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 17 Dec 2024 16:52:18 +0000 (17:52 +0100)
commit32580792df9f07b7b922eba9ea02cbf60c1b07e4
treea86e468d2c6b329182f5c2b241ff3376ddec6890
parent166a678fea3e2301a9be4ba72c5b7f7183615065
pam_systemd: split pam_sm_open_session() into more digestable blocks

Let's separate four different parts of pam_sm_open_session():

1. Acquiring of our various parameters from pam env, pam data, pam items
2. Mangling of that data to clean it up
3. Registering of the service with logind
4. Importing shell credentials into environment variables
5. Enforcement of user record data

This makes the code a lot more readable, and gets rid of an ugly goto
label.

It also corrects things: if step 3 doesnt work because logind is not
around, we'll now still do step 4, which we previously erroneously
skipped.

Besides that no real code changes.
src/login/pam_systemd.c