Commit a92b8e5f authored by Marco Trevisan's avatar Marco Trevisan Committed by Benjamin Berg
Browse files

device: Always return FALSE if setting an error in Check claimed

We may have a case where the sender matches with the
session's sender but have a session invocation already set.

In such case we set an error, but still return TRUE.
parent 29f34cf2
......@@ -473,7 +473,6 @@ _fprint_device_check_claimed (FprintDevice *rdev,
FprintDevicePrivate *priv = fprint_device_get_instance_private(rdev);
g_autoptr(SessionData) session = NULL;
const char *sender;
gboolean retval;
if (requested_state == STATE_IGNORED)
return TRUE;
......@@ -501,14 +500,14 @@ _fprint_device_check_claimed (FprintDevice *rdev,
}
sender = g_dbus_method_invocation_get_sender (invocation);
retval = g_str_equal (sender, session->sender);
if (retval == FALSE || session->invocation != NULL) {
if (!g_str_equal (sender, session->sender) || session->invocation != NULL) {
g_set_error (error, FPRINT_ERROR, FPRINT_ERROR_ALREADY_IN_USE,
_("Device already in use by another user"));
return FALSE;
}
return retval;
return TRUE;
}
static gboolean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment