lib: Fix handling of accountsservice queries for missing users
Since we ported to using FindUserById, it returns an explicit Failed error if a user doesn’t exist. Previously, we would guess at the user’s object path and call a method on it, and would receive a D-Bus ‘method not found’ error in response if the user didn’t exist. Correctly handle the explicit error from FindUserById. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://phabricator.endlessm.com/T24004
This commit is contained in:
parent
de16300aa9
commit
7688308f86
|
@ -509,7 +509,8 @@ bus_error_to_app_filter_error (const GError *bus_error,
|
||||||
return g_error_new (EPC_APP_FILTER_ERROR, EPC_APP_FILTER_ERROR_PERMISSION_DENIED,
|
return g_error_new (EPC_APP_FILTER_ERROR, EPC_APP_FILTER_ERROR_PERMISSION_DENIED,
|
||||||
_("Not allowed to query app filter data for user %u"),
|
_("Not allowed to query app filter data for user %u"),
|
||||||
user_id);
|
user_id);
|
||||||
else if (g_error_matches (bus_error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD))
|
else if (g_error_matches (bus_error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD) ||
|
||||||
|
bus_remote_error_matches (bus_error, "org.freedesktop.Accounts.Error.Failed"))
|
||||||
return g_error_new (EPC_APP_FILTER_ERROR, EPC_APP_FILTER_ERROR_INVALID_USER,
|
return g_error_new (EPC_APP_FILTER_ERROR, EPC_APP_FILTER_ERROR_INVALID_USER,
|
||||||
_("User %u does not exist"), user_id);
|
_("User %u does not exist"), user_id);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue