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:
Thomas Haller 2018-10-23 12:27:30 +02:00
parent 6978558e8c
commit d49e88f716

View file

@ -173,6 +173,7 @@ static gboolean
_internal_write_connection (NMConnection *connection,
const char *keyfile_dir,
const char *profile_dir,
gboolean with_extension,
uid_t owner_uid,
pid_t owner_grp,
const char *existing_path,
@ -229,7 +230,7 @@ _internal_write_connection (NMConnection *connection,
if (existing_path != NULL && !rename) {
path = g_strdup (existing_path);
} 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);
g_free (filename_escaped);
@ -255,7 +256,7 @@ _internal_write_connection (NMConnection *connection,
else
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);
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,
keyfile_dir,
nms_keyfile_utils_get_path (),
TRUE,
0,
0,
existing_path,
@ -383,6 +385,7 @@ nms_keyfile_writer_test_connection (NMConnection *connection,
return _internal_write_connection (connection,
keyfile_dir,
keyfile_dir,
FALSE,
owner_uid,
owner_grp,
NULL,