]> git.ipfire.org Git - thirdparty/systemd.git/commit
pam: cache sd-bus separately per module
authorLuca Boccassi <bluca@debian.org>
Sun, 16 Apr 2023 13:55:09 +0000 (14:55 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 24 Apr 2023 12:18:50 +0000 (14:18 +0200)
commita2dd39b4cb19f4ed4599422e635cc019dcae6ada
treedd917c2c054971bf55775c4b5b0338069f1653de
parentdb0c0f5e003b0a0e202dbc399d35db36087c641c
pam: cache sd-bus separately per module

sd-bus connection is cached by the two pam modules globally, but this
can lead to issues due to hashmaps (used by sd-bus) using a global
static variable for the shared hash key, which is different per module
as both modules are loaded in the same process.

This happens because the sd-bus object is create in one module, but
used in the other, so global state does not match.

Use a different pam cache identifier for the sd-bus pointer, so that
each module uses a different sd-bus connection as a workaround.

Fixes https://github.com/systemd/systemd/issues/27216
Fixes https://github.com/systemd/systemd/issues/17266
src/home/pam_systemd_home.c
src/login/pam_systemd.c
src/shared/pam-util.c
src/shared/pam-util.h