about summary refs log tree commit diff
path: root/clients/cli
diff options
context:
space:
mode:
authorIain Lane <iain.lane@canonical.com>2018-10-03 09:30:23 +0100
committerIain Lane <iain.lane@canonical.com>2018-10-03 09:33:16 +0100
commit898733d427e7b640bab0ea0fa578b3224102fde2 (patch)
tree91c16e4d9d2c363858d1c9ea8a937e0f2c25373a /clients/cli
parent9ba7891e6e49755ef4f3c9e3ef424a9ef06cf58c (diff)
parenteca0cfe89a2a7ec88abe9c03075160f46b338137 (diff)
Merge tag 'debian/1.12.4-1' into cosmic
network-manager Debian release 1.12.4-1
Diffstat (limited to 'clients/cli')
-rw-r--r--clients/cli/common.c6
-rw-r--r--clients/cli/connections.c10
-rw-r--r--clients/cli/devices.c2
3 files changed, 13 insertions, 5 deletions
diff --git a/clients/cli/common.c b/clients/cli/common.c
index 09c86334..4aea0d5b 100644
--- a/clients/cli/common.c
+++ b/clients/cli/common.c
@@ -630,13 +630,13 @@ vpn_openconnect_get_secrets (NMConnection *connection, GPtrArray *secrets)
 		if (!nm_streq0 (secret->vpn_type, NM_SECRET_AGENT_VPN_TYPE_OPENCONNECT))
 			continue;
 
-		if (nm_streq0 (secret->entry_id, NM_SECRET_AGENT_ENTRY_ID_PREFX_VPN_SECRET "cookie")) {
+		if (nm_streq0 (secret->entry_id, NM_SECRET_AGENT_ENTRY_ID_PREFX_VPN_SECRETS "cookie")) {
 			g_free (secret->value);
 			secret->value = g_steal_pointer (&cookie);
-		} else if (nm_streq0 (secret->entry_id, NM_SECRET_AGENT_ENTRY_ID_PREFX_VPN_SECRET "gateway")) {
+		} else if (nm_streq0 (secret->entry_id, NM_SECRET_AGENT_ENTRY_ID_PREFX_VPN_SECRETS "gateway")) {
 			g_free (secret->value);
 			secret->value = g_steal_pointer (&gateway);
-		} else if (nm_streq0 (secret->entry_id, NM_SECRET_AGENT_ENTRY_ID_PREFX_VPN_SECRET "gwcert")) {
+		} else if (nm_streq0 (secret->entry_id, NM_SECRET_AGENT_ENTRY_ID_PREFX_VPN_SECRETS "gwcert")) {
 			g_free (secret->value);
 			secret->value = g_steal_pointer (&gwcert);
 		}
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 1563178d..b547e34c 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -2565,7 +2565,15 @@ parse_passwords (const char *passwd_file, GError **error)
 			return NULL;
 		}
 
-		pwd_spec = g_strdup_printf ("%s.%s", setting, prop);
+		if (   nm_streq (setting, "vpn")
+		    && g_str_has_prefix (prop, "secret.")) {
+			/* in 1.12.0, we wrongly required the VPN secrets to be named
+			 * "vpn.secret". It should be "vpn.secrets". Work around it
+			 * (rh#1628833). */
+			pwd_spec = g_strdup_printf ("vpn.secrets.%s", &prop[NM_STRLEN ("secret.")]);
+		} else
+			pwd_spec = g_strdup_printf ("%s.%s", setting, prop);
+
 		g_hash_table_insert (pwds_hash, pwd_spec, g_strdup (pwd));
 	}
 	return g_steal_pointer (&pwds_hash);
diff --git a/clients/cli/devices.c b/clients/cli/devices.c
index aa28678f..be759732 100644
--- a/clients/cli/devices.c
+++ b/clients/cli/devices.c
@@ -1470,7 +1470,7 @@ nmc_device_state_to_color (NMDeviceState state)
 	else if (state == NM_DEVICE_STATE_ACTIVATED)
 		return NM_META_COLOR_DEVICE_ACTIVATED;
 
-	g_return_val_if_reached (NM_META_COLOR_DEVICE_UNKNOWN);
+	return NM_META_COLOR_DEVICE_UNKNOWN;
 }
 
 static void