]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/shared/bus-polkit.h
core: Pass NULL error in dump_impl()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 28 Apr 2024 17:42:51 +0000 (19:42 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 29 Apr 2024 12:14:40 +0000 (14:14 +0200)
commitba4c69a0c6fafe7eb29988dc1fe0e30ecacad87f
treedcb21f78388bbec86b7fd4e3fae2a0525e800f4a
parent7d7a3c35355a767f345984de0b4f086a18f68568
core: Pass NULL error in dump_impl()

If mac_selinux_access_check() or bus_verify_bypass_dump_ratelimit_async()
fail, we goto "ratelimited" where we set a custom D-BUS error. In
"ratelimited", we call sd_bus_error_setf() which eventually hits an
assert_return(!bus_error_is_dirty()). Avoid hitting this assertion by
passing NULL as the error to mac_selinux_access_check() and
bus_verify_bypass_dump_ratelimit_async() since we will override the error
immediately anyway if either fails.

We modify both functions as well to allow passing a NULL error and fix
the argument name as well while we're at it.
src/core/dbus-manager.c
src/core/selinux-access.c
src/shared/bus-polkit.c
src/shared/bus-polkit.h