man: describe capability checks on the bus
A description of SD_BUS_VTABLE_CAPABILITY is added, and the discussion on SD_BUS_VTABLE_UNPRIVILEGED in expanded. I think it would be nice to add longer description of how access is checked (maybe in sd-bus(3)), but I'm leaving that for later. I think the text that was added here describes everything, even if tersely. Fixes #21882.
This commit is contained in:
@@ -315,11 +315,9 @@ static int check_access(sd_bus *bus, sd_bus_message *m, struct vtable_member *c,
|
||||
if (c->vtable->flags & SD_BUS_VTABLE_UNPRIVILEGED)
|
||||
return 0;
|
||||
|
||||
/* Check have the caller has the requested capability
|
||||
* set. Note that the flags value contains the capability
|
||||
* number plus one, which we need to subtract here. We do this
|
||||
* so that we have 0 as special value for "default
|
||||
* capability". */
|
||||
/* Check that the caller has the requested capability set. Note that the flags value contains the
|
||||
* capability number plus one, which we need to subtract here. We do this so that we have 0 as
|
||||
* special value for the default. */
|
||||
cap = CAPABILITY_SHIFT(c->vtable->flags);
|
||||
if (cap == 0)
|
||||
cap = CAPABILITY_SHIFT(c->parent->vtable[0].flags);
|
||||
|
||||
Reference in New Issue
Block a user