From 61d431a9e8c529ee0fa82b20ffcbd37ff4a37662 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 3 Dec 2019 16:29:15 +0100 Subject: [PATCH] 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 f2dbf8fbc0efd3853100c6e7d7187d649e792793) --- src/nm-manager.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/nm-manager.c b/src/nm-manager.c index 9dd9bf5394..565ee15b23 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,