mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 20:20:09 +01:00
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.
This commit is contained in:
parent
e909778710
commit
108eccf016
1 changed files with 5 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue