From 7991298c51fba372b6f45d6ec58bef584942c99b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 23 Mar 2016 15:58:53 +0100 Subject: [PATCH] core: be strict about connection argument in D-Bus methods There is no excuse for clients to send connections to NetworkManager that have invalid/unknown fields. Just reject them. This is a dangerous change, because we might now reject connections that we were accepting previously. Who know what clients were sending and it used to work. --- src/settings/nm-settings-connection.c | 3 ++- src/settings/nm-settings.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c index bce3dff10..6bed3fe5f 100644 --- a/src/settings/nm-settings-connection.c +++ b/src/settings/nm-settings-connection.c @@ -1736,7 +1736,8 @@ settings_connection_update_helper (NMSettingsConnection *self, /* Check if the settings are valid first */ if (new_settings) { tmp = _nm_simple_connection_new_from_dbus (new_settings, - NM_SETTING_PARSE_FLAGS_NORMALIZE, + NM_SETTING_PARSE_FLAGS_STRICT + | NM_SETTING_PARSE_FLAGS_NORMALIZE, &error); if (!tmp) goto error; diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index fc2daa063..77e45f498 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -1408,7 +1408,8 @@ impl_settings_add_connection_helper (NMSettings *self, GError *error = NULL; connection = _nm_simple_connection_new_from_dbus (settings, - NM_SETTING_PARSE_FLAGS_NORMALIZE, + NM_SETTING_PARSE_FLAGS_STRICT + | NM_SETTING_PARSE_FLAGS_NORMALIZE, &error); if (connection) { -- 2.17.1