Blame SOURCES/1003-manager-accept-non-null-device-for-VPN-activations-rh1641174.patch

c685f3
From 7b6c55fb10c8f500a79075a66d6f5387199392be Mon Sep 17 00:00:00 2001
c685f3
From: Beniamino Galvani <bgalvani@redhat.com>
c685f3
Date: Fri, 6 Jul 2018 15:54:16 +0200
c685f3
Subject: [PATCH] manager: accept non-null device for VPN activations
c685f3
c685f3
Commit 10753c36168a ("manager: merge VPN handling into
c685f3
_new_active_connection()") added a check to fail the activation of
c685f3
VPNs when a device is passed to ActivateConnection(), since the device
c685f3
argument is ignored for VPNs.
c685f3
c685f3
This broke activating VPNs from nm-applet as nm-applet sets both the
c685f3
specific_object (parent-connection) and device arguments in the
c685f3
activation request.
c685f3
c685f3
Note that we already check in _new_active_connection() that when a
c685f3
device is supplied, it matches the device of the parent
c685f3
connection. Therefore, the check can be dropped.
c685f3
c685f3
Reported-by: Michael Biebl <biebl@debian.org>
c685f3
Fixes: 10753c36168a82cd658df8a7da800960fddd78ed
c685f3
c685f3
https://github.com/NetworkManager/NetworkManager/pull/159
c685f3
(cherry picked from commit e205664ba8c25939f1678d1b078a67989c180046)
c685f3
(cherry picked from commit 9748aef7c7982ad1fe377ab6fc64255fcdb52762)
c685f3
---
c685f3
 src/nm-manager.c | 16 +---------------
c685f3
 1 file changed, 1 insertion(+), 15 deletions(-)
c685f3
c685f3
diff --git a/src/nm-manager.c b/src/nm-manager.c
c685f3
index 0fea13de6..289dcf838 100644
c685f3
--- a/src/nm-manager.c
c685f3
+++ b/src/nm-manager.c
c685f3
@@ -4611,21 +4611,7 @@ validate_activation_request (NMManager *self,
c685f3
 		}
c685f3
 	}
c685f3
 
c685f3
-	if (is_vpn && device) {
c685f3
-		/* VPN's are treated specially. Maybe the should accept a device as well,
c685f3
-		 * however, later on during activation, we don't handle the device.
c685f3
-		 *
c685f3
-		 * Maybe we should, and maybe it makes sense to specify a device
c685f3
-		 * when activating a VPN. But for now, just error out.  */
c685f3
-		g_set_error_literal (error,
c685f3
-		                     NM_MANAGER_ERROR,
c685f3
-		                     NM_MANAGER_ERROR_UNKNOWN_DEVICE,
c685f3
-		                     "Cannot specify device when activating VPN");
c685f3
-		return NULL;
c685f3
-	}
c685f3
-
c685f3
-	nm_assert (   ( is_vpn && !device)
c685f3
-	           || (!is_vpn && NM_IS_DEVICE (device)));
c685f3
+	nm_assert (is_vpn || NM_IS_DEVICE (device));
c685f3
 
c685f3
 	*out_device = device;
c685f3
 	*out_is_vpn = is_vpn;
c685f3
-- 
c685f3
2.17.1
c685f3