mirror of
https://github.com/systemd/systemd.git
synced 2025-08-25 13:49:55 +03:00
logind: nicer error message when we cannot guess the caller's session
Partial fix for #6032.
This commit is contained in:
@ -65,6 +65,9 @@ int manager_get_session_from_creds(Manager *m, sd_bus_message *message, const ch
|
||||
return r;
|
||||
|
||||
r = sd_bus_creds_get_session(creds, &name);
|
||||
if (r == -ENXIO)
|
||||
return sd_bus_error_setf(error, BUS_ERROR_NO_SESSION_FOR_PID,
|
||||
"Caller does not belong to any known session");
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
Reference in New Issue
Block a user