Commit 5c3cb477 authored by Daiki Ueno's avatar Daiki Ueno
Browse files

Let PopContext return error if the current context is not owned by the client.

parent 5fd40059
......@@ -367,6 +367,17 @@ handle_method_call (GDBusConnection *connection,
if (server->context_stack) {
ServerContext *context = server->context_stack->data;
if (g_strcmp0 (server_context_get_client_connection (context),
sender) != 0) {
g_dbus_method_invocation_return_error
(invocation,
G_IO_ERROR,
G_IO_ERROR_FAILED_HANDLED,
"the current context not owned by %s",
sender);
return;
}
server_context_set_enabled (context, FALSE);
server->context_stack = g_slist_next (server->context_stack);
g_object_unref (context);
......
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