From: Zbigniew Jędrzejewski-Szmek Date: Tue, 21 May 2024 11:27:53 +0000 (+0200) Subject: logind: use SD_BUS_ERROR_ACCESS_DENIED X-Git-Tag: v256-rc3~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9280b08664f422f51af55c514d76186184370a04;p=thirdparty%2Fsystemd.git logind: use SD_BUS_ERROR_ACCESS_DENIED As requested in post-merge review https://github.com/systemd/systemd/pull/32869#pullrequestreview-2068161094: > NotInControl error is really about session controllers, but this here really > is different. --- diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 5fdf28ced07..a657b6ece3f 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -1191,7 +1191,8 @@ static int method_release_session(sd_bus_message *message, void *userdata, sd_bu return r; if (session != sender_session) - return sd_bus_error_set(error, BUS_ERROR_NOT_IN_CONTROL, "You are not in control of this session"); + return sd_bus_error_set(error, SD_BUS_ERROR_ACCESS_DENIED, + "Refused to release session, since it doesn't match the one of the client"); r = session_release(session); if (r < 0)