DBus properties can have 3 different access mode:
When trying to set a new value to a `readonly` property, we get the DBus error: `org.freedesktop.DBus.Error.PropertyReadOnly`, but there is no such equivalent for trying to read a `write` property.
Admittedly this should not happen too often as I read that the use of write-only properties is discouraged, but since it is explicitly supported, I think we should provide a proper error.
I'm going to assume that the change of assignee and QA contact was either spam or a mistake.
Please do not change the QA contact: we use that field to keep the D-Bus maintainers "in the loop" on all our bugs.
Please do not change the assignee unless you are a D-Bus maintainer, or you are actively working on a bug yourself and you intend to take responsibility for providing a full solution and resolving any issues raised by the maintainers during review.
(In reply to nschoe from comment #0)
> When trying to set a new value to a `readonly` property, we get the DBus
> error: `org.freedesktop.DBus.Error.PropertyReadOnly`, but there is no such
> equivalent for trying to read a `write` property.
As a concrete example, let's suppose we have an object that implements this interface:
property ReadOnly: string, read-only, current value is "hello"
property WriteOnly: string, write-only
property Both: string, read/write, current value is "foo"
For Get("com.example.HasProperties", "WriteOnly") I think bindings have traditionally raised PermissionDenied? If you want to recommend something in the spec, please do a quick survey of major implementations. I don't think it's particularly important to define a separate error here, because as you say, write-only properties are weird and are probably best avoided.
For GetAll("com.example.HasProperties"), Bug #36190 proposes that object implementations should return (using the GVariant notation where <> is a variant):
and silently ignore their inability to fill in a value for WriteOnly. I think that's a good thing to do.
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus/issues/160.