diff options
| author | Michael Biebl <biebl@debian.org> | 2025-09-12 19:47:12 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2025-09-12 19:47:12 +0200 |
| commit | b1655e06d992cd690c0b74f8292ef62f669ecdb1 (patch) | |
| tree | 8b74f02013d9507317e19f4f415c218d619269f8 /src/core/nm-config.c | |
| parent | 6a11a05e66efbf567f52e6a354540f18f3e023b6 (diff) | |
| parent | bc5f10851bffd6af1c2855635be7a28b6dba3195 (diff) | |
Update upstream source from tag 'upstream/1.54.1'
Update to upstream version '1.54.1' with Debian dir e162c0a8d88871855453474e7d890fafe7ea06aa
Diffstat (limited to 'src/core/nm-config.c')
| -rw-r--r-- | src/core/nm-config.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/nm-config.c b/src/core/nm-config.c index a55d2d13..d1f2bbed 100644 --- a/src/core/nm-config.c +++ b/src/core/nm-config.c @@ -18,6 +18,7 @@ #include "libnm-core-intern/nm-core-internal.h" #include "libnm-core-intern/nm-keyfile-internal.h" #include "libnm-core-intern/nm-keyfile-utils.h" +#include "libnm-glib-aux/nm-keyfile-aux.h" #define DEFAULT_CONFIG_MAIN_FILE NMCONFDIR "/NetworkManager.conf" #define DEFAULT_CONFIG_DIR NMCONFDIR "/conf.d" @@ -1046,6 +1047,10 @@ read_config(GKeyFile *keyfile, /* internal groups cannot be set by user configuration. */ continue; } + + if (!g_key_file_has_group(keyfile, group)) + nm_key_file_add_group(keyfile, group); + keys = g_key_file_get_keys(kf, group, &nkeys, NULL); if (!keys) continue; @@ -1639,6 +1644,12 @@ intern_config_read(const char *filename, ""); } + if (!g_key_file_has_group(keyfile_intern, group)) { + nm_key_file_add_group(keyfile_intern, group); + if (is_intern) + has_intern = TRUE; + } + for (k = 0; keys[k]; k++) { gs_free char *value_set = NULL; const char *key = keys[k]; @@ -1823,6 +1834,9 @@ intern_config_write(const char *filename, } } + if (!g_key_file_has_group(keyfile, group)) + nm_key_file_add_group(keyfile, group); + for (k = 0; keys[k]; k++) { const char *key = keys[k]; gs_free char *value_set = NULL; |