mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-02 15:50:13 +01:00
nm-manager: ensure device is exported on D-Bus in authentication request
The device authentication request is an async process, it can not know
the answer right away, it is not guarantee that device is still
exported on D-Bus when authentication finishes. Thus, do not return
SUCCESS and abort the authentication request when device is not alive.
https://bugzilla.redhat.com/show_bug.cgi?id=2210271
(cherry picked from commit b341161e2a)
This commit is contained in:
parent
5c1cb5d3b1
commit
0e27e84247
1 changed files with 15 additions and 0 deletions
|
|
@ -3222,6 +3222,13 @@ device_auth_done_cb(NMAuthChain *chain, GDBusMethodInvocation *context, gpointer
|
|||
nm_assert(error || (result == NM_AUTH_CALL_RESULT_YES));
|
||||
}
|
||||
|
||||
if (!error && !nm_dbus_object_is_exported(NM_DBUS_OBJECT(device))) {
|
||||
g_set_error(&error,
|
||||
NM_MANAGER_ERROR,
|
||||
NM_MANAGER_ERROR_UNKNOWN_DEVICE,
|
||||
"device no longer exists");
|
||||
}
|
||||
|
||||
callback(device, context, subject, error, nm_auth_chain_get_data(chain, "user-data"));
|
||||
}
|
||||
|
||||
|
|
@ -3287,6 +3294,14 @@ nm_manager_device_auth_request(NMManager *self,
|
|||
&error))
|
||||
goto fail_on_idle;
|
||||
|
||||
if (!nm_dbus_object_is_exported(NM_DBUS_OBJECT(device))) {
|
||||
g_set_error(&error,
|
||||
NM_MANAGER_ERROR,
|
||||
NM_MANAGER_ERROR_UNKNOWN_DEVICE,
|
||||
"device no longer exists");
|
||||
goto fail_on_idle;
|
||||
}
|
||||
|
||||
chain = nm_auth_chain_new_subject(subject, context, device_auth_done_cb, self);
|
||||
if (cancellable)
|
||||
nm_auth_chain_set_cancellable(chain, cancellable);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue