settings: ignore unsupported connections when they are loaded

In addition to rejecting new connections added via D-Bus when they are
unsupported, also ignore the existing on-disk ones.
This commit is contained in:
Beniamino Galvani 2025-10-16 16:43:04 +02:00
parent 247000deed
commit c1baf09bf9

View file

@ -1368,10 +1368,11 @@ _connection_changed_track(NMSettings *self,
NMConnection *connection,
gboolean prioritize)
{
NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE(self);
SettConnEntry *sett_conn_entry;
StorageData *sd;
const char *uuid;
NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE(self);
SettConnEntry *sett_conn_entry;
StorageData *sd;
const char *uuid;
gs_free_error GError *error = NULL;
nm_assert_valid_settings_storage(NULL, storage);
@ -1382,6 +1383,17 @@ _connection_changed_track(NMSettings *self,
|| (_nm_connection_verify(connection, NULL) == NM_SETTING_VERIFY_SUCCESS));
nm_assert(!connection || nm_streq0(uuid, nm_connection_get_uuid(connection)));
if (connection && !nm_utils_connection_supported(connection, &error)) {
_LOGD("storage[%s," NM_SETTINGS_STORAGE_PRINT_FMT
"]: ignoring connection \"%s\" from file \"%s\": %s",
uuid,
NM_SETTINGS_STORAGE_PRINT_ARG(storage),
nm_connection_get_id(connection),
nm_settings_storage_get_filename(storage),
error->message);
connection = NULL;
}
nm_assert_connection_unchanging(connection);
sett_conn_entry =