diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2018-11-09 18:06:32 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2018-12-01 15:16:48 +0100 |
commit | 32f4abe90b72ad713ae00ac99a88ae5116f28dbd (patch) | |
tree | fd54e4b2a7c71ff3fdaeaf3efe0eb3211c611123 /src/main.c | |
parent | d46b70328d46e38c538c89e9e0b78d9c8e10bbf6 (diff) | |
download | NetworkManager-32f4abe90b72ad713ae00ac99a88ae5116f28dbd.tar.gz |
config: warn about unknown keys in config files
Emit a warning when we find an unsupported option in a configuration
file.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c index f834fa94fe..36356a7a35 100644 --- a/src/main.c +++ b/src/main.c @@ -155,7 +155,7 @@ nm_main_config_reload (int signal) * * Hence, a NMConfig singleton instance must always be * available. */ - nm_config_reload (nm_config_get (), reload_flags); + nm_config_reload (nm_config_get (), reload_flags, TRUE); } static void @@ -232,6 +232,7 @@ main (int argc, char *argv[]) NMConfigCmdLineOptions *config_cli; guint sd_id = 0; GError *error_invalid_logging_config = NULL; + const char *const *warnings; /* Known to cause a possible deadlock upon GDBus initialization: * https://bugzilla.gnome.org/show_bug.cgi?id=674885 */ @@ -376,6 +377,11 @@ main (int argc, char *argv[]) nm_clear_g_free (&bad_domains); } + warnings = nm_config_get_warnings (config); + for ( ; warnings && *warnings; warnings++) + nm_log_warn (LOGD_CORE, "config: %s", *warnings); + nm_config_clear_warnings (config); + /* the first access to State causes the file to be read (and possibly print a warning) */ nm_config_state_get (config); |