From d4c201272eac243b60d35ee843fa00f323c4d955 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 23 Mar 2016 15:50:20 +0100 Subject: [PATCH] core: be strict about connection argument for Reapply() D-Bus method There is no excuse for clients to send connections to NetworkManager that have invalid/unknown fields. Just reject them. As Reapply() is new API in nm-1-1, there is no problem with backward compatibility. --- src/devices/nm-device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 4f92ec1f2..33d33fa97 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -7369,7 +7369,10 @@ impl_device_reapply (NMDevice *self, if (settings && g_variant_n_children (settings)) { /* New settings specified inline. */ - connection = nm_simple_connection_new_from_dbus (settings, &error); + connection = _nm_simple_connection_new_from_dbus (settings, + NM_SETTING_PARSE_FLAGS_STRICT + | NM_SETTING_PARSE_FLAGS_NORMALIZE, + &error); if (!connection) { g_prefix_error (&error, "The settings specified are invalid: "); nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_REAPPLY, self, FALSE, context, error->message); -- 2.17.1