mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 22:30:11 +01:00
initrd: add .nmconnection extension when writing keyfiles
initrd does not use keyfile API from "src/settings/plugins/keyfile",
hence it does not use nms_keyfile_utils_escape_filename() to add
the ".nmconnection" file extension.
I think that is problematic, because it also misses escapings which
are necessary so that NetworkManager will accept the file.
Anyway, the proper solution here would be to move the keyfile utility
functions to libnm-core, alongside base keyfile API. That way, it
could be used by initrd generator.
For now, just dirty fix the generated filename.
Fixes: 648c256b90
This commit is contained in:
parent
39bd412d28
commit
4ca7fa7f4a
1 changed files with 2 additions and 1 deletions
|
|
@ -63,7 +63,8 @@ output_conn (gpointer key, gpointer value, gpointer user_data)
|
|||
g_print ("%s\n", error->message);
|
||||
g_error_free (error);
|
||||
} else if (connections_dir) {
|
||||
char *filename = g_build_filename (connections_dir, basename, NULL);
|
||||
gs_free char *basename_w_ext = g_strconcat (basename, ".nmconnection", NULL);
|
||||
char *filename = g_build_filename (connections_dir, basename_w_ext, NULL);
|
||||
|
||||
if (!nm_utils_file_set_contents (filename, data, len, 0600, &error)) {
|
||||
g_print ("%s\n", error->message);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue