mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 00:50:16 +01:00
keyfile: namespace commonly-named functions (bgo #639537)
Now that keyfile is built in, we may have symbol naming conflicts with the other plugins where code was copied & pasted around. Fix that by namespacing common function names in the keyfile plugin. Thanks to Giovanni Campagna for pinpointing the issue.
This commit is contained in:
parent
cc88e4e51c
commit
519b1ea61d
4 changed files with 16 additions and 16 deletions
|
|
@ -56,7 +56,7 @@ nm_keyfile_connection_new (const char *full_path,
|
|||
if (source)
|
||||
tmp = g_object_ref (source);
|
||||
else {
|
||||
tmp = connection_from_file (full_path, error);
|
||||
tmp = nm_keyfile_plugin_connection_from_file (full_path, error);
|
||||
if (!tmp)
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1054,7 +1054,7 @@ read_vpn_secrets (GKeyFile *file, NMSettingVPN *s_vpn)
|
|||
}
|
||||
|
||||
NMConnection *
|
||||
connection_from_file (const char *filename, GError **error)
|
||||
nm_keyfile_plugin_connection_from_file (const char *filename, GError **error)
|
||||
{
|
||||
GKeyFile *key_file;
|
||||
struct stat statbuf;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@
|
|||
#include <glib.h>
|
||||
#include <nm-connection.h>
|
||||
|
||||
NMConnection *connection_from_file (const char *filename, GError **error);
|
||||
NMConnection *nm_keyfile_plugin_connection_from_file (const char *filename, GError **error);
|
||||
|
||||
#endif /* _KEYFILE_PLUGIN_READER_H */
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ test_read_valid_wired_connection (void)
|
|||
NMIP6Address *ip6_addr;
|
||||
NMIP6Route *ip6_route;
|
||||
|
||||
connection = connection_from_file (TEST_WIRED_FILE, NULL);
|
||||
connection = nm_keyfile_plugin_connection_from_file (TEST_WIRED_FILE, NULL);
|
||||
ASSERT (connection != NULL,
|
||||
"connection-read", "failed to read %s", TEST_WIRED_FILE);
|
||||
|
||||
|
|
@ -702,7 +702,7 @@ test_write_wired_connection (void)
|
|||
"connection-write", "didn't get keyfile name back after writing connection");
|
||||
|
||||
/* Read the connection back in and compare it to the one we just wrote out */
|
||||
reread = connection_from_file (testfile, NULL);
|
||||
reread = nm_keyfile_plugin_connection_from_file (testfile, NULL);
|
||||
ASSERT (reread != NULL, "connection-write", "failed to re-read test connection");
|
||||
|
||||
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
|
||||
|
|
@ -735,7 +735,7 @@ test_read_ip6_wired_connection (void)
|
|||
const char *expected6_gw1 = "abcd:1234:ffff::cdd1";
|
||||
NMIP6Address *ip6_addr;
|
||||
|
||||
connection = connection_from_file (TEST_WIRED_IP6_FILE, NULL);
|
||||
connection = nm_keyfile_plugin_connection_from_file (TEST_WIRED_IP6_FILE, NULL);
|
||||
ASSERT (connection != NULL,
|
||||
"connection-read", "failed to read %s", TEST_WIRED_IP6_FILE);
|
||||
|
||||
|
|
@ -962,7 +962,7 @@ test_write_ip6_wired_connection (void)
|
|||
"connection-write", "didn't get keyfile name back after writing connection");
|
||||
|
||||
/* Read the connection back in and compare it to the one we just wrote out */
|
||||
reread = connection_from_file (testfile, NULL);
|
||||
reread = nm_keyfile_plugin_connection_from_file (testfile, NULL);
|
||||
ASSERT (reread != NULL, "connection-write", "failed to re-read test connection");
|
||||
|
||||
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
|
||||
|
|
@ -991,7 +991,7 @@ test_read_wired_mac_case (void)
|
|||
const char *expected_id = "Test Wired Connection MAC Case";
|
||||
const char *expected_uuid = "4e80a56d-c99f-4aad-a6dd-b449bc398c57";
|
||||
|
||||
connection = connection_from_file (TEST_WIRED_MAC_CASE_FILE, NULL);
|
||||
connection = nm_keyfile_plugin_connection_from_file (TEST_WIRED_MAC_CASE_FILE, NULL);
|
||||
ASSERT (connection != NULL,
|
||||
"connection-read", "failed to read %s", TEST_WIRED_MAC_CASE_FILE);
|
||||
|
||||
|
|
@ -1077,7 +1077,7 @@ test_read_valid_wireless_connection (void)
|
|||
const guint64 expected_timestamp = 1226604314;
|
||||
guint64 timestamp;
|
||||
|
||||
connection = connection_from_file (TEST_WIRELESS_FILE, NULL);
|
||||
connection = nm_keyfile_plugin_connection_from_file (TEST_WIRELESS_FILE, NULL);
|
||||
ASSERT (connection != NULL,
|
||||
"connection-read", "failed to read %s", TEST_WIRELESS_FILE);
|
||||
|
||||
|
|
@ -1280,7 +1280,7 @@ test_write_wireless_connection (void)
|
|||
"connection-write", "didn't get keyfile name back after writing connection");
|
||||
|
||||
/* Read the connection back in and compare it to the one we just wrote out */
|
||||
reread = connection_from_file (testfile, NULL);
|
||||
reread = nm_keyfile_plugin_connection_from_file (testfile, NULL);
|
||||
ASSERT (reread != NULL, "connection-write", "failed to re-read test connection");
|
||||
|
||||
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
|
||||
|
|
@ -1305,7 +1305,7 @@ test_read_string_ssid (void)
|
|||
const GByteArray *array;
|
||||
const char *expected_ssid = "blah blah ssid 1234";
|
||||
|
||||
connection = connection_from_file (TEST_STRING_SSID_FILE, NULL);
|
||||
connection = nm_keyfile_plugin_connection_from_file (TEST_STRING_SSID_FILE, NULL);
|
||||
ASSERT (connection != NULL,
|
||||
"connection-read", "failed to read %s", TEST_STRING_SSID_FILE);
|
||||
|
||||
|
|
@ -1423,7 +1423,7 @@ test_write_string_ssid (void)
|
|||
g_key_file_free (keyfile);
|
||||
|
||||
/* Read the connection back in and compare it to the one we just wrote out */
|
||||
reread = connection_from_file (testfile, NULL);
|
||||
reread = nm_keyfile_plugin_connection_from_file (testfile, NULL);
|
||||
ASSERT (reread != NULL, "connection-write", "failed to re-read test connection");
|
||||
|
||||
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
|
||||
|
|
@ -1458,7 +1458,7 @@ test_read_bt_dun_connection (void)
|
|||
const char *expected_username = "ISP@CINGULARGPRS.COM";
|
||||
const char *expected_password = "CINGULAR1";
|
||||
|
||||
connection = connection_from_file (TEST_BT_DUN_FILE, NULL);
|
||||
connection = nm_keyfile_plugin_connection_from_file (TEST_BT_DUN_FILE, NULL);
|
||||
ASSERT (connection != NULL,
|
||||
"connection-read", "failed to read %s", TEST_BT_DUN_FILE);
|
||||
|
||||
|
|
@ -1708,7 +1708,7 @@ test_write_bt_dun_connection (void)
|
|||
"connection-write", "didn't get keyfile name back after writing connection");
|
||||
|
||||
/* Read the connection back in and compare it to the one we just wrote out */
|
||||
reread = connection_from_file (testfile, NULL);
|
||||
reread = nm_keyfile_plugin_connection_from_file (testfile, NULL);
|
||||
ASSERT (reread != NULL, "connection-write", "failed to re-read test connection");
|
||||
|
||||
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
|
||||
|
|
@ -1742,7 +1742,7 @@ test_read_gsm_connection (void)
|
|||
const char *expected_network_id = "24005";
|
||||
const char *expected_pin = "2345";
|
||||
|
||||
connection = connection_from_file (TEST_GSM_FILE, NULL);
|
||||
connection = nm_keyfile_plugin_connection_from_file (TEST_GSM_FILE, NULL);
|
||||
ASSERT (connection != NULL,
|
||||
"connection-read", "failed to read %s", TEST_GSM_FILE);
|
||||
|
||||
|
|
@ -1970,7 +1970,7 @@ test_write_gsm_connection (void)
|
|||
"connection-write", "didn't get keyfile name back after writing connection");
|
||||
|
||||
/* Read the connection back in and compare it to the one we just wrote out */
|
||||
reread = connection_from_file (testfile, NULL);
|
||||
reread = nm_keyfile_plugin_connection_from_file (testfile, NULL);
|
||||
ASSERT (reread != NULL, "connection-write", "failed to re-read test connection");
|
||||
|
||||
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue