Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793
Bug-NB: related to NB#218973
|
|
This isn't necessarily OOM: _dbus_gvalue_marshal can fail due to
programming errors. If so, raise a critical warning, then (if that wasn't
fatal) return a D-Bus error to be sent to the caller.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Conflicts:
dbus/dbus-gobject.c
|
|
This is an assertion, not a return_if_fail, because we already checked
the object path in dbus_g_connection_register_g_object and the others
in export_signals.
After these checks, dbus_message_new_signal can really only fail on OOM.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
If the remote process sends us a wrong message, that's its fault, not
ours; we should send back a comprehensible D-Bus error, and not spam
to stderr.
Previously, in each of these cases libdbus would have sent back NoReply,
because we declined to handle the method call.
One case that's still wrong is passing extra arguments to Get, GetAll or
Set, like so:
Get("com.example.Iface", "MyProperty", "extra")
Set("com.example.Iface", "MyProperty", Variant("foo"), "extra")
GetAll("com.example.Iface", "extra")
dbus-glib has historically warned, ignored the extra argument(s) and sent
back a reply as if they hadn't been there, whereas a stricter
implementation (like telepathy-glib's TpDBusPropertiesMixin) would
have sent back an error reply and done nothing.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
Also treat all errors here as programming errors (because this method
should never fail), upgrading them from warning to critical; return a
D-Bus error reply anyway, to be nicer to our callers.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Conflicts:
dbus/dbus-gobject.c
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
We shouldn't report this as OOM, because it probably wasn't (it's much
more likely to be programming error); we should also continue through the
arguments, so that we don't leak them.
By abandoning the message as soon as we detect a programming error,
we can use reply == NULL as an indicator of whether to keep appending.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
I just made it fatal, since it's either programming error or OOM.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
There's no point in doing graceful unwinding here, since it really
shouldn't happen.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
Based on a patch from Christian Dywan <christian.dywan@lanedo.com>.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29884
Bug-NB: NB#180486
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
|
|
This regressed while fixing fd.o #36811. NetworkManager apparently uses
this idiom.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37852
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=628890
Tested-by: Michael Biebl <biebl@debian.org>
Reviewed-by: Colin Walters <walters@verbum.org>
|
|
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=10890
|
|
See https://bugzilla.redhat.com/show_bug.cgi?id=708686 for a case of this; it
would be extremely helpful to figure out what the error actually was since it
appears not to be a double-registration or other such issues after inspection
of nm-applet and libnm-glib.
Reviewed-by: Colin Walters <walters@verbum.org>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37795
|
|
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36811
|
|
there
This has the following results:
* each exported object only needs one weak ref to itself, however many
times it is registered
* because the ObjectRegistration now points to the ObjectExport,
it can always remove itself from the list of registrations even if the
actual object has been disposed, avoiding a leak (fd.o #36811)
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36811
|
|
This fixes a bug in which an empty list of registrations was considered
to be synonymous with the object never having been exported, resulting
in this failure mode:
* register object at n locations
- the first time, export_signals() is called
* unregister all of those locations
* register object at a new location
- export_signals() is wrongly called again
* emit a signal
- the D-Bus signal gets emitted twice
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36811
|
|
This means we no longer need the unnecessarily subtle "steal and put back"
pattern.
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36811
|
|
For simplicity, the ObjectExport struct isn't freed until the object
is actually destroyed, even if there are no more registrations.
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36811
|
|
Previously, we unregistered the object from all connections, if it was
present on more than one.
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32087
|
|
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32087
|
|
At the beginning of the function we steal the object's state so we can add
to the list. After doing that, we must make sure we give it back!
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36793
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
|
|
The list of registrations is singly linked; we only avoid a crash here
by luck.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36793
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
|
|
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171
|
|
Underscores are used and valid according to the specification.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30274
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
|
|
|
|
Because DBus-GLib originally was designed as a generic "object mapping"
binding, the handler for org.freedesktop.DBus.Properties simply
allowed access (read or write) to any GObject property that was
exported.
Later, the (compile time) introspection XML was added, and while we only
listed "exported" properties in the dynamic introspection XML, we
still allowed Get or Set calls to any property that was valid.
With this patch, we deny writes to properties which aren't listed
in the XML, or are listed as read-only.
For backwards compatibility however, we still allow reads. A
service may disable this by calling
dbus_glib_global_set_disable_legacy_property_access().
|
|
Only free the uscore converted name if there's actually a shadow
property registered for this property; otherwise if there is no
shadow property we free the uscore converted one and then return
it immediately after.
|
|
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
|
|
While clients should really register their errors, dbus-glib
shouldn't be passing a malformed error interface to dbus
either. It's just not nice and libdbus will call abort().
See https://bugzilla.redhat.com/show_bug.cgi?id=581794
Signed-off-by: Colin Walters <walters@verbum.org>
|
|
We clearly need to respect the connection when comparing registrations,
since it's perfectly valid to have the same one on two different
connections.
|
|
|
|
Allows dbus-glib clients to handle objects that implement
more than one interface with the properties of the same name.
Normally this would not be allowed since with GObject all
properties are in the same namespace. This patch allows
the interface to register "shadow" properties on a per-interface
basis which redirect the lookup of the property name.
|
|
|
|
https://bugs.freedesktop.org/show_bug.cgi?id=26981
|
|
* dbus/dbus-gobject.c: the < and > symbols broke the sgml generation in
gtk-doc
|
|
The error code names generated my glib-mkenums separate the words by
hyphens which are invalid D-BUS error names. This patch converts them
back to wincaps, but we can't uppercase the first letter.
Based on an original patch from Neil Roberts <neil@linux.intel.com>
|
|
This reverts commit 9637ed9f0c66982a06048b18ccf983881643e456.
This incorrectly uppercased the first character in error names:
https://bugzilla.redhat.com/show_bug.cgi?id=569631
|
|
We were just taking the enumeration nick and appending to the DBus
error name, but since these can contain '-' we need to squash.
|
|
|