summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Zaborowski <andrew.zaborowski@intel.com>2021-03-26 22:56:46 +0100
committerThomas Haller <thaller@redhat.com>2021-04-01 17:19:15 +0200
commitf0fe7384e1d059f6a7d80e2e08188583f02711d9 (patch)
tree164bb895198798036f6abf1af7aaee060cd7ea72
parent2a1b65ce12ee8063910a88674b53b03e1de3cad1 (diff)
downloadNetworkManager-f0fe7384e1d059f6a7d80e2e08188583f02711d9.tar.gz
all: Replace deprecated NM_CONNECTION_SERIALIZE_* flags
Review and replace usages of the two nm_connection_to_dbus() flags marked deprecated in commit 84648e562c98 ('libnm: Refactor NM_CONNECTION_SERIALIZE_* flags'): NM_CONNECTION_SERIALIZE_NO_SECRETS and NM_CONNECTION_SERIALIZE_ONLY_SECRETS.
-rw-r--r--src/core/devices/nm-device.c3
-rw-r--r--src/core/nm-dispatcher.c2
-rw-r--r--src/core/settings/nm-secret-agent.c2
-rw-r--r--src/core/settings/nm-settings-connection.c4
-rw-r--r--src/core/settings/nm-settings.c8
-rw-r--r--src/libnm-core-impl/tests/test-general.c7
-rw-r--r--src/libnm-core-impl/tests/test-secrets.c2
-rw-r--r--src/libnm-core-impl/tests/test-setting.c6
-rw-r--r--src/nmcli/connections.c2
-rw-r--r--src/nmtui/nmt-editor.c2
10 files changed, 19 insertions, 19 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index e93a32d323..7caaa50016 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -12926,7 +12926,8 @@ impl_device_get_applied_connection(NMDBusObject * obj,
return;
}
- var_settings = nm_connection_to_dbus(applied_connection, NM_CONNECTION_SERIALIZE_NO_SECRETS);
+ var_settings =
+ nm_connection_to_dbus(applied_connection, NM_CONNECTION_SERIALIZE_WITH_NON_SECRET);
if (!var_settings)
var_settings = g_variant_new_array(G_VARIANT_TYPE("{sa{sv}}"), NULL, 0);
diff --git a/src/core/nm-dispatcher.c b/src/core/nm-dispatcher.c
index 4fdb905dcf..5862dd0a82 100644
--- a/src/core/nm-dispatcher.c
+++ b/src/core/nm-dispatcher.c
@@ -550,7 +550,7 @@ _dispatcher_call(NMDispatcherAction action,
if (applied_connection)
connection_dict =
- nm_connection_to_dbus(applied_connection, NM_CONNECTION_SERIALIZE_NO_SECRETS);
+ nm_connection_to_dbus(applied_connection, NM_CONNECTION_SERIALIZE_WITH_NON_SECRET);
else
connection_dict = g_variant_new_array(G_VARIANT_TYPE("{sa{sv}}"), NULL, 0);
diff --git a/src/core/settings/nm-secret-agent.c b/src/core/settings/nm-secret-agent.c
index 5493984b7b..45152c2778 100644
--- a/src/core/settings/nm-secret-agent.c
+++ b/src/core/settings/nm-secret-agent.c
@@ -583,7 +583,7 @@ nm_secret_agent_delete_secrets(NMSecretAgent * self,
priv = NM_SECRET_AGENT_GET_PRIVATE(self);
/* No secrets sent; agents must be smart enough to track secrets using the UUID or something */
- dict = nm_connection_to_dbus(connection, NM_CONNECTION_SERIALIZE_NO_SECRETS);
+ dict = nm_connection_to_dbus(connection, NM_CONNECTION_SERIALIZE_WITH_NON_SECRET);
call_id = _call_id_new(self, METHOD_DELETE_SECRETS, path, NULL, callback, callback_data);
diff --git a/src/core/settings/nm-settings-connection.c b/src/core/settings/nm-settings-connection.c
index 83ca261060..294cb04705 100644
--- a/src/core/settings/nm-settings-connection.c
+++ b/src/core/settings/nm-settings-connection.c
@@ -1333,7 +1333,7 @@ get_settings_auth_cb(NMSettingsConnection * self,
* protected against leakage of secrets to unprivileged callers.
*/
settings = nm_connection_to_dbus_full(nm_settings_connection_get_connection(self),
- NM_CONNECTION_SERIALIZE_NO_SECRETS,
+ NM_CONNECTION_SERIALIZE_WITH_NON_SECRET,
&options);
g_dbus_method_invocation_return_value(context, g_variant_new("(@a{sa{sv}})", settings));
}
@@ -1866,7 +1866,7 @@ dbus_get_agent_secrets_cb(NMSettingsConnection * self,
* by the time we get here.
*/
dict = nm_connection_to_dbus(nm_settings_connection_get_connection(self),
- NM_CONNECTION_SERIALIZE_ONLY_SECRETS);
+ NM_CONNECTION_SERIALIZE_WITH_SECRETS);
if (!dict)
dict = g_variant_new_array(G_VARIANT_TYPE("{sa{sv}}"), NULL, 0);
g_dbus_method_invocation_return_value(context, g_variant_new("(@a{sa{sv}})", dict));
diff --git a/src/core/settings/nm-settings.c b/src/core/settings/nm-settings.c
index 92733f5dbf..4c43484d39 100644
--- a/src/core/settings/nm-settings.c
+++ b/src/core/settings/nm-settings.c
@@ -1541,9 +1541,7 @@ _add_connection_to_first_plugin(NMSettings * self,
}
agent_owned_secrets =
- nm_connection_to_dbus(new_connection,
- NM_CONNECTION_SERIALIZE_ONLY_SECRETS
- | NM_CONNECTION_SERIALIZE_WITH_SECRETS_AGENT_OWNED);
+ nm_connection_to_dbus(new_connection, NM_CONNECTION_SERIALIZE_WITH_SECRETS_AGENT_OWNED);
connection_to_add_real =
_connection_changed_normalize_connection(storage,
connection_to_add,
@@ -2218,9 +2216,7 @@ nm_settings_update_connection(NMSettings * self,
nm_assert(nm_streq(uuid, nm_settings_storage_get_uuid(new_storage)));
agent_owned_secrets =
- nm_connection_to_dbus(connection,
- NM_CONNECTION_SERIALIZE_ONLY_SECRETS
- | NM_CONNECTION_SERIALIZE_WITH_SECRETS_AGENT_OWNED);
+ nm_connection_to_dbus(connection, NM_CONNECTION_SERIALIZE_WITH_SECRETS_AGENT_OWNED);
new_connection_real = _connection_changed_normalize_connection(new_storage,
new_connection,
agent_owned_secrets,
diff --git a/src/libnm-core-impl/tests/test-general.c b/src/libnm-core-impl/tests/test-general.c
index f75401693e..146eeee20f 100644
--- a/src/libnm-core-impl/tests/test-general.c
+++ b/src/libnm-core-impl/tests/test-general.c
@@ -2583,7 +2583,10 @@ test_setting_to_dbus_no_secrets(void)
s_wsec = make_test_wsec_setting("setting-to-dbus-no-secrets");
- dict = _nm_setting_to_dbus(NM_SETTING(s_wsec), NULL, NM_CONNECTION_SERIALIZE_NO_SECRETS, NULL);
+ dict = _nm_setting_to_dbus(NM_SETTING(s_wsec),
+ NULL,
+ NM_CONNECTION_SERIALIZE_WITH_NON_SECRET,
+ NULL);
/* Make sure non-secret keys are there */
g_assert(_variant_contains(dict, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT));
@@ -2606,7 +2609,7 @@ test_setting_to_dbus_only_secrets(void)
s_wsec = make_test_wsec_setting("setting-to-dbus-only-secrets");
dict =
- _nm_setting_to_dbus(NM_SETTING(s_wsec), NULL, NM_CONNECTION_SERIALIZE_ONLY_SECRETS, NULL);
+ _nm_setting_to_dbus(NM_SETTING(s_wsec), NULL, NM_CONNECTION_SERIALIZE_WITH_SECRETS, NULL);
/* Make sure non-secret keys are not there */
g_assert(!_variant_contains(dict, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT));
diff --git a/src/libnm-core-impl/tests/test-secrets.c b/src/libnm-core-impl/tests/test-secrets.c
index e371795c74..0d33df6e97 100644
--- a/src/libnm-core-impl/tests/test-secrets.c
+++ b/src/libnm-core-impl/tests/test-secrets.c
@@ -605,7 +605,7 @@ test_update_secrets_whole_connection_empty_base_setting(void)
*/
connection = wifi_connection_new();
- secrets = nm_connection_to_dbus(connection, NM_CONNECTION_SERIALIZE_ONLY_SECRETS);
+ secrets = nm_connection_to_dbus(connection, NM_CONNECTION_SERIALIZE_WITH_SECRETS);
g_assert_cmpint(g_variant_n_children(secrets), ==, 3);
setting = g_variant_lookup_value(secrets, NM_SETTING_WIRELESS_SETTING_NAME, NULL);
diff --git a/src/libnm-core-impl/tests/test-setting.c b/src/libnm-core-impl/tests/test-setting.c
index 0f80826bcb..7d8d078b8b 100644
--- a/src/libnm-core-impl/tests/test-setting.c
+++ b/src/libnm-core-impl/tests/test-setting.c
@@ -3245,8 +3245,8 @@ test_roundtrip_conversion(gconstpointer test_data)
gs_unref_ptrarray GPtrArray * wg_peers = NULL;
const NMConnectionSerializationFlags dbus_serialization_flags[] = {
NM_CONNECTION_SERIALIZE_ALL,
- NM_CONNECTION_SERIALIZE_NO_SECRETS,
- NM_CONNECTION_SERIALIZE_ONLY_SECRETS,
+ NM_CONNECTION_SERIALIZE_WITH_NON_SECRET,
+ NM_CONNECTION_SERIALIZE_WITH_SECRETS,
};
guint dbus_serialization_flags_idx;
gs_unref_object NMConnection *con = NULL;
@@ -3643,7 +3643,7 @@ test_roundtrip_conversion(gconstpointer test_data)
if (flag == NM_CONNECTION_SERIALIZE_ALL)
_rndt_wg_peers_assert_equal(s_wg2, wg_peers, TRUE, TRUE, FALSE);
- else if (flag == NM_CONNECTION_SERIALIZE_NO_SECRETS)
+ else if (flag == NM_CONNECTION_SERIALIZE_WITH_NON_SECRET)
_rndt_wg_peers_assert_equal(s_wg2, wg_peers, FALSE, FALSE, TRUE);
else
g_assert_not_reached();
diff --git a/src/nmcli/connections.c b/src/nmcli/connections.c
index 74a5b6e260..50f684c0e6 100644
--- a/src/nmcli/connections.c
+++ b/src/nmcli/connections.c
@@ -5821,7 +5821,7 @@ gen_cmd_print0(const char *text, int state)
int i = 0;
settings = nm_connection_to_dbus(nmc_tab_completion.connection,
- NM_CONNECTION_SERIALIZE_NO_SECRETS);
+ NM_CONNECTION_SERIALIZE_WITH_NON_SECRET);
words = g_new(char *, g_variant_n_children(settings) + 2);
g_variant_iter_init(&iter, settings);
while (g_variant_iter_next(&iter, "{&s@a{sv}}", &setting_name, NULL))
diff --git a/src/nmtui/nmt-editor.c b/src/nmtui/nmt-editor.c
index 40cee1b0f8..0ef236938f 100644
--- a/src/nmtui/nmt-editor.c
+++ b/src/nmtui/nmt-editor.c
@@ -216,7 +216,7 @@ build_edit_connection(NMConnection *orig_connection)
if (!NM_IS_REMOTE_CONNECTION(orig_connection))
return edit_connection;
- settings = nm_connection_to_dbus(orig_connection, NM_CONNECTION_SERIALIZE_NO_SECRETS);
+ settings = nm_connection_to_dbus(orig_connection, NM_CONNECTION_SERIALIZE_WITH_NON_SECRET);
g_variant_iter_init(&iter, settings);
while (g_variant_iter_next(&iter, "{&s@a{sv}}", &setting_name, NULL)) {
if (!nm_meta_setting_info_editor_has_secrets(