about summary refs log tree commit diff
path: root/src/supplicant
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-06-04 00:08:31 +0200
committerMichael Biebl <biebl@debian.org>2018-06-04 00:08:31 +0200
commit0dd9df69fdbd475c48a0c8d5b0a1882550fe7321 (patch)
tree249cf25643b1fe408e10679bb61613bc6540e894 /src/supplicant
parent2e94a3b93171ab3fb95bf689aab1664d23988809 (diff)
parent04bc9e1cd3544445d883ad29ea108c1645c8e7b7 (diff)
Update upstream source from tag 'upstream/1.11.4'
Update to upstream version '1.11.4'
with Debian dir d0638aa2e32d5bae4e8daa021b9a66b7c4d6647e
Diffstat (limited to 'src/supplicant')
-rw-r--r--src/supplicant/nm-supplicant-config.c11
-rw-r--r--src/supplicant/nm-supplicant-settings-verify.c7
-rw-r--r--src/supplicant/nm-supplicant-settings-verify.h1
-rw-r--r--src/supplicant/tests/meson.build2
-rw-r--r--src/supplicant/tests/test-supplicant-config.c6
5 files changed, 12 insertions, 15 deletions
diff --git a/src/supplicant/nm-supplicant-config.c b/src/supplicant/nm-supplicant-config.c
index 14f5cac8..80db5baa 100644
--- a/src/supplicant/nm-supplicant-config.c
+++ b/src/supplicant/nm-supplicant-config.c
@@ -144,7 +144,7 @@ nm_supplicant_config_add_option_with_type (NMSupplicantConfig *self,
 			memset (&buf[0], 0, sizeof (buf));
 			memcpy (&buf[0], value, len > 254 ? 254 : len);
 			g_set_error (error, NM_SUPPLICANT_ERROR, NM_SUPPLICANT_ERROR_CONFIG,
-			             "key '%s' and/or value '%s' invalid", key, hidden ? hidden : buf);
+			             "key '%s' and/or value '%s' invalid", key, hidden ?: buf);
 			return FALSE;
 		}
 	}
@@ -168,7 +168,7 @@ nm_supplicant_config_add_option_with_type (NMSupplicantConfig *self,
 		char buf[255];
 		memset (&buf[0], 0, sizeof (buf));
 		memcpy (&buf[0], opt->value, opt->len > 254 ? 254 : opt->len);
-		nm_log_info (LOGD_SUPPLICANT, "Config: added '%s' value '%s'", key, hidden ? hidden : &buf[0]);
+		nm_log_info (LOGD_SUPPLICANT, "Config: added '%s' value '%s'", key, hidden ?: &buf[0]);
 	}
 
 	g_hash_table_insert (priv->config, g_strdup (key), opt);
@@ -275,7 +275,6 @@ nm_supplicant_config_finalize (GObject *object)
 	G_OBJECT_CLASS (nm_supplicant_config_parent_class)->finalize (object);
 }
 
-
 static void
 nm_supplicant_config_class_init (NMSupplicantConfigClass *klass)
 {
@@ -980,7 +979,7 @@ add_pkcs11_uri_with_pin (NMSupplicantConfig *self,
 
 	tmp = g_strdup_printf ("%s%s%s", split[0],
 	                       (pin_qattr ? "?" : ""),
-	                       (pin_qattr ? pin_qattr : ""));
+	                       (pin_qattr ?: ""));
 
 	tmp_log = g_strdup_printf ("%s%s%s", split[0],
 	                           (pin_qattr ? "?" : ""),
@@ -1172,7 +1171,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
 
 	/* CA path */
 	path = nm_setting_802_1x_get_ca_path (setting);
-	path = ca_path_override ? ca_path_override : path;
+	path = ca_path_override ?: path;
 	if (path) {
 		if (!add_string_val (self, path, "ca_path", FALSE, NULL, error))
 			return FALSE;
@@ -1180,7 +1179,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
 
 	/* Phase2 CA path */
 	path = nm_setting_802_1x_get_phase2_ca_path (setting);
-	path = ca_path_override ? ca_path_override : path;
+	path = ca_path_override ?: path;
 	if (path) {
 		if (!add_string_val (self, path, "ca_path2", FALSE, NULL, error))
 			return FALSE;
diff --git a/src/supplicant/nm-supplicant-settings-verify.c b/src/supplicant/nm-supplicant-settings-verify.c
index 5198d75f..317afff9 100644
--- a/src/supplicant/nm-supplicant-settings-verify.c
+++ b/src/supplicant/nm-supplicant-settings-verify.c
@@ -36,7 +36,6 @@ struct Opt {
 	const char **    str_allowed;
 };
 
-
 static gboolean validate_type_int     (const struct Opt * opt,
                                        const char * value,
                                        const guint32 len);
@@ -67,7 +66,6 @@ static const struct validate_entry validate_table[] = {
 	{ TYPE_KEYWORD, validate_type_keyword },
 };
 
-
 const char * pairwise_allowed[] = { "CCMP", "TKIP", "NONE", NULL };
 const char * group_allowed[] =    { "CCMP", "TKIP", "WEP104", "WEP40", NULL };
 const char * proto_allowed[] =    { "WPA", "RSN", NULL };
@@ -155,7 +153,6 @@ static const struct Opt opt_table[] = {
 	{ "ieee80211w",         TYPE_INT,     0, 2, FALSE, NULL },
 };
 
-
 static gboolean
 validate_type_int (const struct Opt * opt,
                    const char * value,
@@ -190,7 +187,7 @@ validate_type_bytes (const struct Opt * opt,
 	g_return_val_if_fail (opt != NULL, FALSE);
 	g_return_val_if_fail (value != NULL, FALSE);
 
-	check_len = opt->int_high ? opt->int_high : 255;
+	check_len = opt->int_high ?: 255;
 	if (len > check_len)
 		return FALSE;
 
@@ -207,7 +204,7 @@ validate_type_utf8 (const struct Opt *opt,
 	g_return_val_if_fail (opt != NULL, FALSE);
 	g_return_val_if_fail (value != NULL, FALSE);
 
-	check_len = opt->int_high ? opt->int_high : 255;
+	check_len = opt->int_high ?: 255;
 	/* Note that we deliberately don't validate the UTF-8, because
 	   some "UTF-8" fields, such as 8021x.password, do not actually
 	   have to be valid UTF-8 */
diff --git a/src/supplicant/nm-supplicant-settings-verify.h b/src/supplicant/nm-supplicant-settings-verify.h
index 920343ba..1eec136d 100644
--- a/src/supplicant/nm-supplicant-settings-verify.h
+++ b/src/supplicant/nm-supplicant-settings-verify.h
@@ -34,5 +34,4 @@ OptType nm_supplicant_settings_verify_setting (const char * key,
                                                const char * value,
                                                const guint32 len);
 
-
 #endif /* __NETWORKMANAGER_SUPPLICANT_SETTINGS_VERIFY_H__ */
diff --git a/src/supplicant/tests/meson.build b/src/supplicant/tests/meson.build
index e6a86b20..b8bad7f3 100644
--- a/src/supplicant/tests/meson.build
+++ b/src/supplicant/tests/meson.build
@@ -4,7 +4,7 @@ exe = executable(
   test_unit,
   test_unit + '.c',
   dependencies: test_nm_dep,
-  c_args: '-DTEST_CERT_DIR="@0@"'.format(join_paths(meson.current_source_dir(), 'certs'))
+  c_args: nm_build_cflags,
 )
 
 test(
diff --git a/src/supplicant/tests/test-supplicant-config.c b/src/supplicant/tests/test-supplicant-config.c
index 60ca5258..36831e67 100644
--- a/src/supplicant/tests/test-supplicant-config.c
+++ b/src/supplicant/tests/test-supplicant-config.c
@@ -37,6 +37,10 @@
 
 #include "nm-test-utils-core.h"
 
+#define TEST_CERT_DIR                         NM_BUILD_SRCDIR"/src/supplicant/tests/certs"
+
+/*****************************************************************************/
+
 static gboolean
 validate_opt (const char *detail,
               GVariant *config,
@@ -138,7 +142,6 @@ build_supplicant_config (NMConnection *connection,
 	g_assert_no_error (error);
 	g_assert (success);
 
-
 	success = nm_supplicant_config_add_bgscan (config, connection, &error);
 	g_assert_no_error (error);
 	g_assert (success);
@@ -146,7 +149,6 @@ build_supplicant_config (NMConnection *connection,
 	return nm_supplicant_config_to_variant (config);
 }
 
-
 static NMConnection *
 new_basic_connection (const char *id,
                       GBytes *ssid,