diff options
Diffstat (limited to 'libnm-core/nm-keyfile.c')
-rw-r--r-- | libnm-core/nm-keyfile.c | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/libnm-core/nm-keyfile.c b/libnm-core/nm-keyfile.c index 4de0ca415f..77c1534d53 100644 --- a/libnm-core/nm-keyfile.c +++ b/libnm-core/nm-keyfile.c @@ -2855,17 +2855,9 @@ nm_keyfile_read_ensure_uuid (NMConnection *connection, /** * nm_keyfile_read: * @keyfile: the keyfile from which to create the connection - * @keyfile_name: keyfile allows missing connection id and uuid - * and NetworkManager will create those when reading a connection - * from file. By providing a filename you can reproduce that behavior, - * but of course, it can only recreate the same UUID if you provide the - * same filename as NetworkManager core daemon would. - * @keyfile_name has only a relevance for setting the id or uuid if it - * is missing and as fallback for @base_dir. * @base_dir: when reading certificates from files with relative name, - * the relative path is made absolute using @base_dir. - * If @base_dir is missing, first try to get the pathname from @keyfile_name - * (if it is given as absolute path). As last, fallback to the current path. + * the relative path is made absolute using @base_dir. This must + * be an absolute path. * @handler: read handler * @user_data: user data for read handler * @error: error @@ -2877,7 +2869,6 @@ nm_keyfile_read_ensure_uuid (NMConnection *connection, */ NMConnection * nm_keyfile_read (GKeyFile *keyfile, - const char *keyfile_name, const char *base_dir, NMKeyfileReadHandler handler, void *user_data, @@ -2888,25 +2879,13 @@ nm_keyfile_read (GKeyFile *keyfile, NMSetting *setting; char **groups; gsize length; - int i; + gsize i; gboolean vpn_secrets = FALSE; KeyfileReaderInfo info = { 0 }; - gs_free char *base_dir_free = NULL; g_return_val_if_fail (keyfile, NULL); g_return_val_if_fail (!error || !*error, NULL); - - if (!base_dir) { - /* basedir is not given. Prefer it from the keyfile_name */ - if (keyfile_name && keyfile_name[0] == '/') { - base_dir = base_dir_free = g_path_get_dirname (keyfile_name); - } else { - /* if keyfile is not given or not an absolute path, fallback - * to current working directory. */ - base_dir = base_dir_free = g_get_current_dir (); - } - } else - g_return_val_if_fail (base_dir[0] == '/', NULL); + g_return_val_if_fail (base_dir && base_dir[0] == '/', NULL); connection = nm_simple_connection_new (); @@ -2942,15 +2921,6 @@ nm_keyfile_read (GKeyFile *keyfile, nm_connection_add_setting (connection, NM_SETTING (s_con)); } - if (keyfile_name) { - gs_free char *basename = g_path_get_basename (keyfile_name); - - nm_keyfile_read_ensure_id (connection, basename); - } - - if (keyfile_name) - nm_keyfile_read_ensure_uuid (connection, keyfile_name); - /* Make sure that we have 'interface-name' even if it was specified in the * "wrong" (ie, deprecated) group. */ |