Skip to content

Commit 857fac7

Browse files
Katariina Lounentobluca
authored andcommitted
man: document unprivileged is not for reading properties
Document the fact that read-only properties may not have the flag SD_BUS_VTABLE_UNPRIVILEGED as that is not obvious especially given the flag is accepted for writable properties. Based on the check in `add_object_vtable_internal` called by `sd_bus_add_object_vtable` (as of the current tip of the main branch f7f5ba0): case _SD_BUS_VTABLE_PROPERTY: { [...] if ([...] || [...] (v->flags & SD_BUS_VTABLE_UNPRIVILEGED && v->type == _SD_BUS_VTABLE_PROPERTY)) { r = -EINVAL; goto fail; } (where `_SD_BUS_VTABLE_PROPERTY` means read-only property whereas `_SD_BUS_VTABLE_WRITABLE_PROPERTY` maps to writable property). This was implemented in the commit adacb95 ("bus: introduce "trusted" bus concept and encode access control in object vtables") where `SD_BUS_VTABLE_UNPRIVILEGED` was introduced: Writable properties are also subject to SD_BUS_VTABLE_UNPRIVILEGED and SD_BUS_VTABLE_CAPABILITY() for controlling write access to them. Note however that read access is unrestricted, as PropertiesChanged messages might send out the values anyway as an unrestricted broadcast. (cherry picked from commit 3ca09aa) (cherry picked from commit cd72703) (cherry picked from commit f694a84) (cherry picked from commit 0aea62b) (cherry picked from commit 413d82c) (cherry picked from commit a85962c)
1 parent abdd947 commit 857fac7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

man/sd_bus_add_object.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,9 @@
593593
<constant>org.freedesktop.systemd1.Privileged</constant> annotation with value
594594
<literal>true</literal> will be shown in introspection data.</para>
595595

596+
<para><constant>SD_BUS_VTABLE_UNPRIVILEGED</constant> may not be applied to read-only properties,
597+
but read access (to both read-only and writable properties) is always unrestricted.</para>
598+
596599
<para>Note that this page describes checks implemented in the D-Bus client. The D-Bus server has an
597600
additional policy that may permit or deny connections, see
598601
"CONFIGURATION FILE" in

0 commit comments

Comments
 (0)