Bug 36190

Summary: Spec clarifications for org.freedesktop.Properties.GetAll
Product: dbus Reporter: David Zeuthen (not reading bugmail) <zeuthen>
Component: coreAssignee: D-Bus Maintainers <dbus>
Status: RESOLVED FIXED QA Contact: D-Bus Maintainers <dbus>
Severity: normal    
Priority: medium CC: bugzilla, msniko14, smcv
Version: 1.5Keywords: patch
Hardware: All   
OS: All   
Whiteboard: review+
i915 platform: i915 features:
Attachments: spec: Clarify behaviour of o.f.D.P.GetAll

Description David Zeuthen (not reading bugmail) 2011-04-12 15:25:12 UTC
The spec should clarify what is returned for propertyless interfaces, cf. what Simon says in bug 34869 comment 9. Suggest to return a propertyless interface.

Should probably also clarify what to do when one or more properties wouldn't have been returned by the Get() call because e.g. the sender is not authorized (or any other reason why Get() would fail). Right now the GDBus implementation silenty just skips that property:

 http://git.gnome.org/browse/glib/tree/gio/gdbusconnection.c?id=2.28.5#n4079

which is probably the right behavior. Anyway, need to clarify that.
Comment 1 Simon McVittie 2011-06-27 08:36:56 UTC
See also Bug #22156 which mostly implements your suggestion in dbus-glib.

(In reply to comment #0)
> Should probably also clarify what to do when one or more properties wouldn't
> have been returned by the Get() call because e.g. the sender is not authorized
> (or any other reason why Get() would fail).

dbus-glib doesn't support this case: because g_object_get_property() can't fail, Get() can't fail either (except for silly marshalling-related reasons).

telepathy-glib's TpDBusPropertiesMixin doesn't support this case either: if anyone can read a property, everyone can read it.

If you support this, I think skipping it in GetAll() is OK; but possibly access control should be at (object, interface) granularity, and Get() and GetAll() should both fail for the entire interface?
Comment 2 Philip Withnall 2016-11-01 04:21:44 UTC
Created attachment 127657 [details] [review]
spec: Clarify behaviour of o.f.D.P.GetAll

Clarify its intended behaviour in two situations:
 • For interfaces which have no properties.
 • Where some properties are not visible to the caller (due to access
   control, for example).

The intention here is for this behaviour to be mandatory, but given that
this is quite late on in the specification’s life, and various D-Bus
libraries like dbus-glib and telepathy-glib cannot support access
control at a per-property level, for example. GDBus can, although it’s
questionable whether this is a good idea. Deliberately leave the
specification open to allow access control at a higher level as well
(such as per-(object, interface)).
Comment 3 Philip Withnall 2016-11-01 04:22:10 UTC
In the spirit of resolving old bugs because everyone likes watertight specifications…
Comment 4 Simon McVittie 2016-11-21 12:04:05 UTC
Comment on attachment 127657 [details] [review]
spec: Clarify behaviour of o.f.D.P.GetAll

Review of attachment 127657 [details] [review]:
-----------------------------------------------------------------

I like this patch. Any objections from the other maintainers?
Comment 5 Simon McVittie 2016-11-22 11:29:20 UTC
Fixed in git for spec 0.30 (dbus 1.11.8). Thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.