manager: forbid autoactivation of parent when it is blocked by user request

If a device is being autoactivated and requires a parent that is
blocked due to user request, the autoactivation attempt should fail
because NM shouldn't overrule the user decision.

https://bugzilla.redhat.com/show_bug.cgi?id=1765566
(cherry picked from commit f2dbf8fbc0)
This commit is contained in:
Beniamino Galvani 2019-12-03 16:29:15 +01:00
parent 73a2557a6f
commit 61d431a9e8

View file

@ -4673,6 +4673,15 @@ _internal_activate_device (NMManager *self, NMActiveConnection *active, GError *
return FALSE;
}
if ( nm_active_connection_get_activation_reason (active) == NM_ACTIVATION_REASON_AUTOCONNECT
&& nm_settings_connection_autoconnect_blocked_reason_get (parent_con,
NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_USER_REQUEST)) {
g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_DEPENDENCY_FAILED,
"the parent connection of %s cannot autoactivate because it is blocked due to user request",
nm_device_get_iface (device));
return FALSE;
}
parent_ac = nm_manager_activate_connection (self,
parent_con,
NULL,