diff options
| author | Michael Biebl <biebl@debian.org> | 2022-03-07 21:31:48 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2022-03-07 21:31:48 +0100 |
| commit | b002c8cf4a4edaf7067563fc1d59545b5c88cc99 (patch) | |
| tree | 6818612f86964c1dd79bb373feb4f443eeb2dd69 /src/core/settings | |
| parent | a31332e76bee4c5977e2ef9daeeddb205bad27ea (diff) | |
| parent | 4f887bccf1cde84106588536584a2d54a5b4e6e5 (diff) | |
Update upstream source from tag 'upstream/1.36.2'
Update to upstream version '1.36.2' with Debian dir ababed5cf88a964e7aac789b48238ba3cf57f0b4
Diffstat (limited to 'src/core/settings')
| -rw-r--r-- | src/core/settings/nm-settings.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/core/settings/nm-settings.c b/src/core/settings/nm-settings.c index da09571b..6619d3e0 100644 --- a/src/core/settings/nm-settings.c +++ b/src/core/settings/nm-settings.c @@ -3266,7 +3266,7 @@ add_plugin(NMSettings *self, NMSettingsPlugin *plugin, const char *pname, const } static gboolean -add_plugin_load_file(NMSettings *self, const char *pname, GError **error) +add_plugin_load_file(NMSettings *self, const char *pname, gboolean ignore_not_found, GError **error) { gs_free char *full_name = NULL; gs_free char *path = NULL; @@ -3281,10 +3281,12 @@ add_plugin_load_file(NMSettings *self, const char *pname, GError **error) if (stat(path, &st) != 0) { errsv = errno; - _LOGW("could not load plugin '%s' from file '%s': %s", - pname, - path, - nm_strerror_native(errsv)); + if (!ignore_not_found) { + _LOGW("could not load plugin '%s' from file '%s': %s", + pname, + path, + nm_strerror_native(errsv)); + } return TRUE; } if (!S_ISREG(st.st_mode)) { @@ -3378,7 +3380,7 @@ load_plugins(NMSettings *self, const char *const *plugins, GError **error) continue; } - success = add_plugin_load_file(self, pname, error); + success = add_plugin_load_file(self, pname, FALSE, error); if (!success) break; } @@ -3872,8 +3874,18 @@ nm_settings_start(NMSettings *self, GError **error) /* Load the plugins; fail if a plugin is not found. */ plugins = nm_config_data_get_plugins(nm_config_get_data_orig(priv->config), TRUE); - if (!load_plugins(self, (const char *const *) plugins, error)) - return FALSE; + if (plugins && plugins[0]) { + if (!load_plugins(self, (const char *const *) plugins, error)) + return FALSE; + } else { + add_plugin_keyfile(self); +#if WITH_CONFIG_PLUGIN_IFCFG_RH + add_plugin_load_file(self, "ifcfg-rh", TRUE, NULL); +#endif +#if WITH_CONFIG_PLUGIN_IFUPDOWN + add_plugin_load_file(self, "ifupdown", TRUE, NULL); +#endif + } for (iter = priv->plugins; iter; iter = iter->next) { NMSettingsPlugin *plugin = NM_SETTINGS_PLUGIN(iter->data); |