-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pam_systemd: some refactorings and bugfixes #35178
Merged
Merged
+341
−275
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
please-review
PR is ready for (re-)review by a maintainer
util-lib
labels
Nov 15, 2024
keszybz
approved these changes
Nov 15, 2024
keszybz
added
good-to-merge/with-minor-suggestions
and removed
please-review
PR is ready for (re-)review by a maintainer
labels
Nov 15, 2024
poettering
added
good-to-merge/waiting-for-ci 👍
PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed
and removed
good-to-merge/with-minor-suggestions
labels
Nov 19, 2024
poettering
force-pushed
the
pam-systemd-refactor
branch
from
November 19, 2024 09:29
65250fa
to
af282c1
Compare
YHNdnzj
reviewed
Nov 19, 2024
YHNdnzj
reviewed
Nov 19, 2024
YHNdnzj
added
good-to-merge/with-minor-suggestions
and removed
good-to-merge/waiting-for-ci 👍
PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed
labels
Nov 19, 2024
poettering
force-pushed
the
pam-systemd-refactor
branch
from
November 27, 2024 14:24
af282c1
to
49593f9
Compare
poettering
added
good-to-merge/waiting-for-ci 👍
PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed
and removed
good-to-merge/after-next-release
labels
Dec 11, 2024
poettering
force-pushed
the
pam-systemd-refactor
branch
from
December 11, 2024 09:38
49593f9
to
9963a6e
Compare
yuwata
approved these changes
Dec 11, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Several minor comments.
yuwata
added
good-to-merge/with-minor-suggestions
and removed
good-to-merge/waiting-for-ci 👍
PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed
labels
Dec 11, 2024
Let's make it more like the parsing of the "incomplete" boolean env var, to streamline things.
We never use the field and this is not going to change... This addresses a weird asymmetry, as create_session_message() always went to the process' own PID when doing pidfds but otherwise (i.e. without pidfds) would honour the PID specified as function parameter.
Let's instead just pass over the UserRecord, it's a much more useful object with lots more information we'll sooner or later need (preparation for later commits).
… move it later Let's shorten the code of pam_sm_open_session() a bit, and also make sure the importing of the env vars from the creds also happens if the session registration with logind is skipped.
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.
We got confused by the error codes here, and sometimes return PAM errors where the caller propagated them unconverted as negative errno errors. Fix that.
This is to pam_get_data() what pam_get_item() is to pam_get_item_many().
poettering
force-pushed
the
pam-systemd-refactor
branch
from
December 17, 2024 16:55
9963a6e
to
f07fe27
Compare
poettering
added
good-to-merge/waiting-for-ci 👍
PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed
and removed
good-to-merge/with-minor-suggestions
labels
Dec 17, 2024
github-actions
bot
removed
the
good-to-merge/waiting-for-ci 👍
PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed
label
Dec 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inspired at #35171 I had another closer look at pam_systemd, and found a bunch of things to fix, and correct.