summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-12-03 16:29:15 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2019-12-11 13:46:57 +0100
commitf2dbf8fbc0efd3853100c6e7d7187d649e792793 (patch)
tree257faa309d92b3566bcf0b42b6efe47eaf70ecea
parentce2cceef83f3a720922f5c906c641466809e6ba4 (diff)
downloadNetworkManager-bg/parent-autoactivate-rh1765566.tar.gz
manager: forbid autoactivation of parent when it is blocked by user requestbg/parent-autoactivate-rh1765566
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
-rw-r--r--src/nm-manager.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index a900acbcd4..3150aefd9a 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -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,