Skip to content

Commit

Permalink
logind: use SD_BUS_ERROR_ACCESS_DENIED
Browse files Browse the repository at this point in the history
As requested in post-merge review
#32869 (review):
> NotInControl error is really about session controllers, but this here really
> is different.
  • Loading branch information
keszybz committed May 21, 2024
1 parent 688b701 commit 9280b08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/login/logind-dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9280b08

Please sign in to comment.