polkit: when authorizing via PK let's re-resolve callback/userdata instead of caching it 84/288084/1
authorLennart Poettering <lennart@poettering.net>
Wed, 22 Jan 2020 16:07:47 +0000 (17:07 +0100)
committerYoungjae Cho <y0.cho@samsung.com>
Fri, 10 Feb 2023 07:50:33 +0000 (16:50 +0900)
commitcb794ee6f4590ceec7d3e9c5a5e6b460b528a1c8
treeb97fa720871eb44b4c0d815189d12e7c6c67f964
parent81d00f9d9c8c6e63c41bc2c9a77103305c32a124
polkit: when authorizing via PK let's re-resolve callback/userdata instead of caching it

Previously, when doing an async PK query we'd store the original
callback/userdata pair and call it again after the PK request is
complete. This is problematic, since PK queries might be slow and in the
meantime the userdata might be released and re-acquired. Let's avoid
this by always traversing through the message handlers so that we always
re-resolve the callback and userdata pair and thus can be sure it's
up-to-date and properly valid.

Origin: upstream, https://github.com/systemd/systemd/commit/637486261528e8aa3da9f26a4487dc254f4b7abb
Change-Id: Ifaeb5142c9a574a04017167fbccc45388cc72956
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/shared/bus-polkit.c