mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 03:38:09 +02:00
Revert "keyfile: drop with_extension argument from _internal_write_connection()"
For upstream, we changed behavior here. However, I think certain
downstream don't want to do that, and revert patch "d37ad15f12 keyfile:
also add ".nmconnection" extension when writing keyfiles in /etc".
For that to make easier, keep the upstream sources closer to what
was. Revert.
This reverts commit e93d8cdb74.
This commit is contained in:
parent
6978558e8c
commit
d49e88f716
1 changed files with 5 additions and 2 deletions
|
|
@ -173,6 +173,7 @@ static gboolean
|
||||||
_internal_write_connection (NMConnection *connection,
|
_internal_write_connection (NMConnection *connection,
|
||||||
const char *keyfile_dir,
|
const char *keyfile_dir,
|
||||||
const char *profile_dir,
|
const char *profile_dir,
|
||||||
|
gboolean with_extension,
|
||||||
uid_t owner_uid,
|
uid_t owner_uid,
|
||||||
pid_t owner_grp,
|
pid_t owner_grp,
|
||||||
const char *existing_path,
|
const char *existing_path,
|
||||||
|
|
@ -229,7 +230,7 @@ _internal_write_connection (NMConnection *connection,
|
||||||
if (existing_path != NULL && !rename) {
|
if (existing_path != NULL && !rename) {
|
||||||
path = g_strdup (existing_path);
|
path = g_strdup (existing_path);
|
||||||
} else {
|
} else {
|
||||||
char *filename_escaped = nm_keyfile_utils_create_filename (id, TRUE);
|
char *filename_escaped = nm_keyfile_utils_create_filename (id, with_extension);
|
||||||
|
|
||||||
path = g_build_filename (keyfile_dir, filename_escaped, NULL);
|
path = g_build_filename (keyfile_dir, filename_escaped, NULL);
|
||||||
g_free (filename_escaped);
|
g_free (filename_escaped);
|
||||||
|
|
@ -255,7 +256,7 @@ _internal_write_connection (NMConnection *connection,
|
||||||
else
|
else
|
||||||
filename = g_strdup_printf ("%s-%s-%u", id, nm_connection_get_uuid (connection), i);
|
filename = g_strdup_printf ("%s-%s-%u", id, nm_connection_get_uuid (connection), i);
|
||||||
|
|
||||||
filename_escaped = nm_keyfile_utils_create_filename (filename, TRUE);
|
filename_escaped = nm_keyfile_utils_create_filename (filename, with_extension);
|
||||||
|
|
||||||
g_free (path);
|
g_free (path);
|
||||||
path = g_strdup_printf ("%s/%s", keyfile_dir, filename_escaped);
|
path = g_strdup_printf ("%s/%s", keyfile_dir, filename_escaped);
|
||||||
|
|
@ -360,6 +361,7 @@ nms_keyfile_writer_connection (NMConnection *connection,
|
||||||
return _internal_write_connection (connection,
|
return _internal_write_connection (connection,
|
||||||
keyfile_dir,
|
keyfile_dir,
|
||||||
nms_keyfile_utils_get_path (),
|
nms_keyfile_utils_get_path (),
|
||||||
|
TRUE,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
existing_path,
|
existing_path,
|
||||||
|
|
@ -383,6 +385,7 @@ nms_keyfile_writer_test_connection (NMConnection *connection,
|
||||||
return _internal_write_connection (connection,
|
return _internal_write_connection (connection,
|
||||||
keyfile_dir,
|
keyfile_dir,
|
||||||
keyfile_dir,
|
keyfile_dir,
|
||||||
|
FALSE,
|
||||||
owner_uid,
|
owner_uid,
|
||||||
owner_grp,
|
owner_grp,
|
||||||
NULL,
|
NULL,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue