]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/home/pam_systemd_home.c
pam-systemd: disconnect bus connection when leaving session hook, even on error 27346/head
authorLennart Poettering <lennart@poettering.net>
Thu, 20 Apr 2023 12:02:39 +0000 (14:02 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 27 Apr 2023 15:04:05 +0000 (17:04 +0200)
commitba8d00e859c82b8c1f31d515a48d9b56af1dc9ec
tree7449163e57b7ca8f981ab556ddb081e6384b8122
parent402014086d12b2b8ac524c5354ddcb4bb059ca59
pam-systemd: disconnect bus connection when leaving session hook, even on error

This adds support for systematically destroying connections in
pam_sm_session_open() even on failure, so that under no circumstances
unserved dbus connection are around while the invoking process waits for
the session to end.  Previously we'd only do this on success, now do it
in all cases.

This matters since so far we suggested people hook pam_systemd into
their pam stacks prefixed with "-", so that login proceeds even if
pam_systemd fails. This however means that in an error case our
cached connection doesn't get disconnected even if the session then is
invoked. This fixes that.
src/home/pam_systemd_home.c
src/login/pam_systemd.c
src/shared/pam-util.c
src/shared/pam-util.h