auth-manager: don't process idle calls when the proxy creation finishes

The list of calls contains two kinds of elements: (1) calls that don't
need a D-Bus request and are only waiting for the asynchronous
invocation of the callback in an idle function; (2) calls that need a
D-Bus request and are waiting for the D-Bus proxy.

When the proxy creation finishes, only (2) calls must be canceled (if
the creation failed) or started (if the proxy was created).

Fixes: 798b2a7527

https://bugzilla.redhat.com/show_bug.cgi?id=1567807
This commit is contained in:
Beniamino Galvani 2018-04-16 14:32:06 +02:00
parent 41e0ca6824
commit d0563f0733

View file

@ -517,8 +517,10 @@ _dbus_new_proxy_cb (GObject *source_object,
_LOGE ("could not create polkit proxy: %s", error->message);
while ((call_id = c_list_first_entry (&priv->calls_lst_head, NMAuthManagerCallId, calls_lst))) {
_LOG2T (call_id, "completed: failed due to no D-Bus proxy after startup");
_call_id_invoke_callback (call_id, FALSE, FALSE, error);
if (call_id->dbus_parameters) {
_LOG2T (call_id, "completed: failed due to no D-Bus proxy after startup");
_call_id_invoke_callback (call_id, FALSE, FALSE, error);
}
}
return;
}
@ -536,8 +538,10 @@ _dbus_new_proxy_cb (GObject *source_object,
_log_name_owner (self, NULL);
while ((call_id = c_list_first_entry (&priv->calls_lst_head, NMAuthManagerCallId, calls_lst))) {
_LOG2T (call_id, "CheckAuthorization invoke now");
_call_check_authorize (call_id);
if (call_id->dbus_parameters) {
_LOG2T (call_id, "CheckAuthorization invoke now");
_call_check_authorize (call_id);
}
}
_emit_changed_signal (self);