summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFernando Fernandez Mancera <ffmancera@riseup.net>2023-08-23 16:00:43 +0200
committerFernando Fernandez Mancera <ffmancera@riseup.net>2023-08-23 16:00:43 +0200
commit194b381d3889882e7ba28f9d4a77abaf6ab21eb3 (patch)
tree38171c92fd31626685f08a3ab3c4f41834f59599
parentf55f848833025540c432b47a3938b14154eca5a2 (diff)
parentb341161e2a4988403ae4a6ef7653e01567da36a0 (diff)
manager: merge branch 'wl/device_auth_request_fix'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1716
-rw-r--r--src/core/nm-manager.c15
-rw-r--r--src/core/nm-policy.c17
2 files changed, 23 insertions, 9 deletions
diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c
index 2175a9c48f..4fb9194a28 100644
--- a/src/core/nm-manager.c
+++ b/src/core/nm-manager.c
@@ -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);
diff --git a/src/core/nm-policy.c b/src/core/nm-policy.c
index 024f76546c..efdb06360f 100644
--- a/src/core/nm-policy.c
+++ b/src/core/nm-policy.c
@@ -1662,15 +1662,14 @@ nm_policy_device_recheck_auto_activate_schedule(NMPolicy *self, NMDevice *device
g_return_if_fail(NM_IS_POLICY(self));
g_return_if_fail(NM_IS_DEVICE(device));
- if (g_signal_handler_find(device,
- G_SIGNAL_MATCH_DATA,
- 0,
- 0,
- NULL,
- NULL,
- NM_POLICY_GET_PRIVATE(self))
- == 0)
- return;
+ nm_assert(g_signal_handler_find(device,
+ G_SIGNAL_MATCH_DATA,
+ 0,
+ 0,
+ NULL,
+ NULL,
+ NM_POLICY_GET_PRIVATE(self))
+ != 0);
if (!c_list_is_empty(&device->policy_auto_activate_lst)) {
/* already queued. Return. */