From d1f269ab36ea5e06e54658ca1b06daf83639a585 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 20 Jun 2019 15:45:34 +0200 Subject: [PATCH] core: ensure normalized connection during add-and-activate nm_connection_verify() returns success for fully valid (normalized) connections and also connections that are NM_SETTING_VERIFY_NORMALIZABLE. We really want to fully normalize the profiles during add-and-activate. --- src/devices/nm-device.c | 2 +- src/nm-manager.c | 2 ++ src/settings/nm-settings.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 8fe3e5776f..abcff229bf 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -5753,7 +5753,7 @@ nm_device_complete_connection (NMDevice *self, error)) return FALSE; - if (!nm_connection_verify (connection, error)) + if (!nm_connection_normalize (connection, NULL, NULL, error)) return FALSE; return nm_device_check_connection_compatible (self, connection, error); diff --git a/src/nm-manager.c b/src/nm-manager.c index 9dfc84c979..d653dc174a 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -5517,6 +5517,8 @@ impl_manager_add_and_activate_connection (NMDBusObject *obj, goto error; } + nm_assert (_nm_connection_verify (incompl_conn, NULL) == NM_SETTING_VERIFY_SUCCESS); + active = _new_active_connection (self, is_vpn, NULL, diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index b8457aca38..6fbda5274b 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -720,7 +720,7 @@ nm_settings_add_connection_dbus (NMSettings *self, g_return_if_fail (G_IS_DBUS_METHOD_INVOCATION (context)); /* Connection must be valid, of course */ - if (!nm_connection_verify (connection, &tmp_error)) { + if (_nm_connection_verify (connection, &tmp_error) != NM_SETTING_VERIFY_SUCCESS) { error = g_error_new (NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, "The connection was invalid: %s",