Commit graph

2718 commits

Author SHA1 Message Date
Lennart Poettering
2c34514620 protocol: introduce four new errors
UnknownInterface, UnknownObject, UnknownProperty and PropertyReadOnly,
as discussed on the ML.

The first two are already used by various bindings, such as the Qt and
Java binding, but have never been made official.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34527
Reviewed-by: David Zeuthen <davidz@redhat.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-03-10 21:10:31 +01:00
Simon McVittie
09c9d6406b Make dbus_type_is_valid into public API
This is just as useful for bindings as dbus_signature_validate, and I
think it's a good design principle to say that anything checked in a
_dbus_return_if_fail should be something the caller could check
for themselves.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=20496
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-03-10 19:14:55 +00:00
Simon McVittie
8299a41aa6 Merge branch 'dbus-1.4' 2011-03-10 19:07:15 +00:00
Simon McVittie
d1d3957744 add doxygen.stamp to .gitignore
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35182
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-03-10 19:06:27 +00:00
Simon McVittie
1aa5aaa9e2 _dbus_marshal_write_fixed_multi: remove obsolete FIXME comment
As far as I can tell, we've never accepted out-of-range booleans and
canonicalized them, ever since this was first committed in 2004. If sent,
they'd be considered to be invalid by recipients, so they're unambiguously
an error.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35182
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-03-10 19:06:20 +00:00
Simon McVittie
abdd6adf06 dbus_message_iter_append_basic: remove misleading documentation
This function specifically doesn't support Unix fds and is documented as
such.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35182
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-03-10 19:05:51 +00:00
Simon McVittie
23d4a2ec5d Implement uninstallation and cleanup for Doxygen docs, fixing distcheck
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-03-10 19:00:23 +00:00
Simon McVittie
4012b00955 Merge branch 'validate-when-sending-16338' into dbus-1.4
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-03-10 18:59:29 +00:00
Simon McVittie
d60cc351fe dbus_type_is_basic etc.: it is an error to pass in bad typecodes
Previously, the comments said "this function will crash", but that's not
strictly true (checks can be disabled or made non-fatal). Their behaviour
is undefined if you do that, though.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=20496
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-03-10 18:58:37 +00:00
Simon McVittie
9759973233 Require specific user action to compile without 64-bit support
The D-Bus type system isn't implementable without 64-bit support, although
for historical reasons we have some sort of semi-working support for
platforms with no 64-bit integers. Let's find out whether any
practically relevant platform still lacks these types...

(GLib appears to have required 64-bit integer types since 2001.)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35114
Reviewed-by: Lennart Poettering <lennart@poettering.net>
2011-03-10 12:16:24 +00:00
Simon McVittie
24cdbddbe6 Merge branch 'dbus-1.4' 2011-03-10 12:15:56 +00:00
Lennart Poettering
eb6d268f58 autogen: add -I m4 to aclocal path
This fixes 2b5959882a which forgot to add
m4/ to the command line of aclocal but moved scripts there.
2011-03-10 03:56:23 +01:00
Simon McVittie
257a6ef496 Merge branch 'dbus-1.4' 2011-03-08 12:35:46 +00:00
Simon McVittie
9ad0881fff Update NEWS 2011-03-08 12:35:39 +00:00
Simon McVittie
3013fafae5 Merge branch 'dbus-1.4' 2011-03-07 14:51:46 +00:00
Simon McVittie
2e40818280 Fix some more stray occurrences of ELEMENT_TYPE 2011-03-07 13:55:10 +00:00
Andre Heinecke
e0fc90bdf2 Do not use the name ELEMENT_TYPE
On Windows Systems ELEMENT_TYPE is already defined
in Winioctl.h this header is included indirectly
in dbus-sysdeps.h. By avoiding the use of the Name
ELEMENT_TYPE it is ensured that config-parser-common.h
can be included together with dbus-sysdeps.h

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-03-07 13:50:38 +00:00
Simon McVittie
a9cbeecfcc dbus_message_iter_append_fixed_array: add a check for valid booleans
The reasoning is the same as for dbus_message_iter_append_basic.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=16338
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-03-04 12:40:40 +00:00
Simon McVittie
bb32afe831 dbus_message_iter_append_basic: validate booleans too
Sending, for instance, ((dbus_bool_t) 666) is a programming error and
should be diagnosed as such.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=16338
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-03-04 12:40:30 +00:00
Simon McVittie
b1d29497d6 dbus_message_iter_append_basic: check string-like arguments for validity
Strings: UTF-8 with no embedded NULs, by adding a new internal function,
_dbus_check_is_valid_utf8

Object paths, signatures: the obvious syntactic checks

This moves some of the burden of validation to the sender.

When sending <http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt>
10240 times with up to 1024 parallel calls pending, on a single-core ARM
Linux device, I found that user CPU time in dbus-spam increased by up to 80%
as a result of the validation. However, when sending messages to dbus-daemon,
overall throughput only reduced by 15%, and when sending messages to an echo
service, overall throughput actually improved by around 14% (presumably
because making the sender CPU-bound influenced kernel scheduling).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=16338
Bug-NB: NB#223152
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-03-04 12:39:59 +00:00
Simon McVittie
07d2ca2b52 Merge branch 'dbus-1.4'
Conflicts:
	NEWS
2011-02-25 15:49:55 +00:00
Simon McVittie
f1ba52066c Merge branch 'doxygenate' into dbus-1.4
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Conflicts:
	configure.ac
	doc/Makefile.am
2011-02-25 15:49:19 +00:00
Simon McVittie
c728addb61 NEWS so far 2011-02-25 12:08:48 +00:00
Simon McVittie
c35e12fda9 Merge branch 'changequote' into dbus-1.4
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-02-25 12:02:02 +00:00
Simon McVittie
be5e2b23c9 Merge branch 'require-display-for-autolaunch-19997' into dbus-1.4
Reviewed-by: Colin Walters <walters@verbum.org>
2011-02-25 12:01:33 +00:00
Simon McVittie
20d2f1702f Merge branch 'modern-autofoo-32245' into dbus-1.4 2011-02-25 11:30:17 +00:00
Simon McVittie
f04e52a2e5 Allow X11 autolaunch to be disabled even if the headers/libraries are there
In an embedded system where the D-Bus session is a core part of the
environment, like Maemo, accidentally auto-launching a second session bus
(for instance for a concurrent ssh session) is a bad idea - it can lead
to a "split brain" situation where half the applications in the GUI are
using a different bus. In these controlled environments, it'd be useful
to prevent autolaunch from ever happening.

(As a side benefit, the changes to configure.in also mean that packagers
can explicitly --enable-x11-autolaunch, to make sure that failure to find
X will make compilation fail cleanly.)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19997
Bug-NB: NB#219964
2011-02-24 18:58:18 +00:00
Simon McVittie
407c111672 Don't attempt Unix X11 autolaunching if DISPLAY isn't set
The known use cases for autolaunching (ssh -Y firefox,
run konqueror in legacy DE) all need $DISPLAY too.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19997
2011-02-24 18:43:34 +00:00
Simon McVittie
31a1b24c93 Merge branch 'dbus-1.4' 2011-02-24 18:40:31 +00:00
Simon McVittie
7848abe6c2 config-parser regression test: don't require that fd.o #34496 exists
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-02-24 18:40:11 +00:00
Simon McVittie
d9e1959dcf Merge branch 'dbus-1.4' 2011-02-24 17:17:36 +00:00
Simon McVittie
3681753421 Give XDG_DATA_HOME priority over XDG_DATA_DIRS for servicedirs
According to the XDG Base Directory Specification, “the base directory
defined by $XDG_DATA_HOME is considered more important than any of the
base directories defined by $XDG_DATA_DIRS.”  This makes it easier to
override a system service file as a normal user.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34496
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 17:17:22 +00:00
Simon McVittie
fb06b43956 Honour aclocal flags in Makefile.am, rather than gluing them onto ACLOCAL
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:58:01 +00:00
Simon McVittie
260f70e0af Modernize setup of libtool for Windows
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:56:58 +00:00
Simon McVittie
9af8013cc9 Use AC_CONFIG_HEADERS, not AM_CONFIG_HEADER
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:53:08 +00:00
Simon McVittie
5595182b65 Modernize AC_INIT usage, with a bug report URL
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:52:21 +00:00
Simon McVittie
3346c86798 Require a somewhat modern version of autoconf and automake
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:51:39 +00:00
Simon McVittie
54af6bee3e Modernize AC_OUTPUT usage
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:48:29 +00:00
Simon McVittie
dbc7637f13 Modernize checks in ld_supports_flag
Part of a patch by Javier Jardón.

(This will conflict with changes from my gc-sections branch -smcv)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:48:14 +00:00
Simon McVittie
7fe24aacd2 Modernize checks for DBUS__ACQUIRE_SVC
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:47:28 +00:00
Simon McVittie
9bedcb0717 Modernize checks for monotonic clock
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:46:52 +00:00
Simon McVittie
dac0a716ad Modernize checks for cmsgcred
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:46:34 +00:00
Simon McVittie
5906c072da Modernize checks for ISO/GNU varargs
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:46:21 +00:00
Simon McVittie
07a54bb2f1 Modernize checks for socklen_t
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:46:00 +00:00
Simon McVittie
1704a7d483 Modernize checks for non-POSIX getpwnam_r
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:45:48 +00:00
Simon McVittie
cc2c19c164 Modernize checks for dirfd/dd_fd
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-02-24 15:45:31 +00:00
Simon McVittie
ff04d7397a Rename configure.in to configure.ac
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
2011-02-24 15:43:24 +00:00
Simon McVittie
5cad083069 Don't compress spaces in CFLAGS and friends
Not all sed implementations understand "+" with its POSIX extended regular
expression semantics, and compressing spaces is purely cosmetic anyway.
Let's just drop this.
2011-02-24 15:20:18 +00:00
Simon McVittie
e2d0048421 Remove unnecessary changequote call
Nothing in the changequote'd environment uses square brackets anyway.
2011-02-24 15:16:38 +00:00
Simon McVittie
5c06992e62 Use square brackets (m4 quoting) instead of changequote
For more details, see:
http://www.gnu.org/software/autoconf/manual/html_node/Changequote-is-Evil.html
2011-02-24 15:16:26 +00:00