summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-11-22 14:39:22 +0100
committerThomas Haller <thaller@redhat.com>2018-11-22 14:51:21 +0100
commit108eccf01647f6599a21e55a2ab12bca117ca26d (patch)
tree3cfa94ce9c3fb3cef7fc1d13c3c9a9b60a966d11
parente9097787102442d1db6e1ebfbe07140bf05318a2 (diff)
downloadNetworkManager-108eccf01647f6599a21e55a2ab12bca117ca26d.tar.gz
core: use nm_g_object_set_property() for setting properties from D-Bus
g_object_set_property() cannot fail nor signal an error reason when invalid arguments are passed. Use our wrapper nm_g_object_set_property() instead. Note that the input argument comes from untrusted (although authenticated) source.
-rw-r--r--src/nm-manager.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index ac863fc59a..5060b4923c 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -6651,6 +6651,7 @@ _dbus_set_property_auth_cb (NMAuthChain *chain,
gs_unref_object NMManager *self = handle_data->self;
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
NMAuthCallResult result;
+ gs_free_error GError *local = NULL;
const char *error_name = NULL;
const char *error_message = NULL;
GValue gvalue;
@@ -6688,7 +6689,10 @@ _dbus_set_property_auth_cb (NMAuthChain *chain,
}
g_dbus_gvariant_to_gvalue (value, &gvalue);
- g_object_set_property (G_OBJECT (obj), property_info->property_name, &gvalue);
+ if (!nm_g_object_set_property (G_OBJECT (obj), property_info->property_name, &gvalue, &local)) {
+ error_name = "org.freedesktop.DBus.Error.InvalidArgs";
+ error_message = local->message;
+ }
g_value_unset (&gvalue);
out: