mirror of
https://github.com/systemd/systemd.git
synced 2025-03-21 02:50:18 +03:00
sd-bus: improve error message for invalid org.freedesktop.DBus.Properties.Set signature
Fixes #12551.
This commit is contained in:
parent
727036325a
commit
8da24acad5
@ -638,8 +638,14 @@ static int property_get_set_callbacks_run(
|
||||
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));
|
||||
if (type != 'v')
|
||||
return sd_bus_reply_method_errorf(m, SD_BUS_ERROR_INVALID_SIGNATURE,
|
||||
"Incorrect signature when setting property '%s', expected 'v', got '%c'.",
|
||||
c->member, type);
|
||||
if (!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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user