Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.1:Update
systemd-mini.4328
0001-sd-bus-create-clean-error-when-a-property-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-sd-bus-create-clean-error-when-a-property-Set-call-w.patch of Package systemd-mini.4328
Based on 0ca454d474a13f363dcd5ef8dc97ca158569d3ed Mon Sep 17 00:00:00 2001 From: Lennart Poettering <lennart@poettering.net> Date: Thu, 20 Nov 2014 20:58:39 +0100 Subject: [PATCH] sd-bus: create clean error when a property Set() call with incorrect signature is passed in --- src/libsystemd/sd-bus/bus-objects.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- src/libsystemd/sd-bus/bus-objects.c +++ src/libsystemd/sd-bus/bus-objects.c 2015-07-30 00:00:00.000000000 +0000 @@ -579,6 +579,9 @@ static int property_get_set_callbacks_ru return r; } else { + const char *signature = NULL; + char type = 0; + if (c->vtable->type != _SD_BUS_VTABLE_WRITABLE_PROPERTY) return sd_bus_reply_method_errorf(m, SD_BUS_ERROR_PROPERTY_READ_ONLY, "Property '%s' is not writable.", c->member); @@ -590,6 +593,13 @@ static int property_get_set_callbacks_ru c->last_iteration = bus->iteration_counter; + r = sd_bus_message_peek_type(m, &type, &signature); + if (r < 0) + return r; + + if (type != 'v' || !streq(strempty(signature), strempty(c->vtable->x.property.signature))) + return sd_bus_reply_method_errorf(m, SD_BUS_ERROR_INVALID_ARGS, "Incorrect parameters for property '%s', expected '%s', got '%s'.", c->member, strempty(c->vtable->x.property.signature), strempty(signature)); + r = sd_bus_message_enter_container(m, 'v', c->vtable->x.property.signature); if (r < 0) return r;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor