summaryrefslogtreecommitdiff
path: root/dbus
Commit message (Collapse)AuthorAgeFilesLines
* Check that watches are removed, then invalidated, then unreffedSimon McVittie2011-06-132-1/+8
| | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33336 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Reviewed-by: Thiago Macieira <thiago@kde.org>
* Always remove, invalidate and free watches before closing watched socketsSimon McVittie2011-06-135-70/+98
| | | | | | | | | | | | | | This should mean we don't get invalid fds in the main loop. The BSD (kqueue) and Windows code paths are untested, but follow the same patterns as the tested Linux/generic Unix versions. DBusTransportSocket was already OK (it called free_watches() before _dbus_close_socket, and that did the remove, invalidate, unref dance). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33336 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Reviewed-by: Thiago Macieira <thiago@kde.org>
* Merge branch 'dbus-1.4'Simon McVittie2011-06-105-73/+61
|\
| * Add and use DBUS_TIMEOUT_INFINITE and DBUS_TIMEOUT_USE_DEFAULTSimon McVittie2011-06-103-6/+36
| | | | | | | | | | | | | | | | | | | | | | The documentation claimed that INT_MAX (whatever that means) meant the default, but the value that has actually always been checked for is 0x7fffffff (aka INT32_MAX on the competent platforms we sadly don't restrict our portability to), so we should use that. (In practice D-Bus probably never worked on platforms where int wasn't 32 bits, though.) Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
| * dbus_message_demarshal_bytes_needed: correct a wrong assertionSimon McVittie2011-06-101-1/+1
| | | | | | | | | | | | | | | | It's entirely possible for a message to indicate how many bytes we need, without actually being complete. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
| * _dbus_header_byteswap: change the first byte of the message, not just the ↵Simon McVittie2011-06-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | struct member This has been wrong approximately forever, for instance see: http://lists.freedesktop.org/archives/dbus/2007-March/007357.html Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=629938 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
| * Consistently use atomic operations for all access to DBusConnection refcountSimon McVittie2011-06-101-66/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying to mix atomic operations with locked non-atomic operations is broken: the atomic ops aren't necessarily atomic with respect to the locked non-atomic ops, and the non-atomic ops aren't protected by the lock because the atomic ops can change the refcount behind their back. In theory we could use the connection lock if atomic ops aren't supported (making a per-connection lock cheaper than the global lock used to implement atomic ops) *and* our mutexes are recursive (making it safe against deadlocks)... but life's too short. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38005 Tested-by: Will Manley <freedesktop williammanley net> Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
* | Fixes for Visual Studio 2010 cmake generator - reported by Ray Satiro.Ralf Habacker2011-05-281-3/+0
| |
* | Merge branch 'dbus-1.4'Simon McVittie2011-05-252-2/+2
|\ \ | |/
| * process_config_first_time_only: initialize syslog as intended.Simon McVittie2011-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On Linux, we previously called openlog() (with different options!) while initializing SELinux; leave SELinux messages as LOG_USER|LOG_INFO in case anyone was relying on that, but let the rest of our log messages come out as LOG_DAEMON. Also enable LOG_PERROR (copy syslog messages to stderr) unconditionally; we can make this an autoconf check if anyone's pet Unix doesn't have LOG_PERROR. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35358 Reviewed-by: Colin Walters <walters@verbum.org>
| * _dbus_init_system_log: remove FIXME on WindowsSimon McVittie2011-05-251-1/+1
| | | | | | | | | | | | | | We don't need any initialization here, so there's nothing to fix. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35358 Reviewed-by: Colin Walters <walters@verbum.org>
* | Merge branch 'dbus-1.4'Simon McVittie2011-05-251-1/+1
|\ \ | |/
| * Check for X even if X11 autolaunching is disabledSimon McVittie2011-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DBUS_ENABLE_X11_AUTOLAUNCH obviously requires DBUS_BUILD_X11. However, the converse is not true. If DBUS_BUILD_X11 is defined, dbus-launch will be able to connect to the X server to determine when the session ends; most distributors will want this, but it can be disabled with the standard Autoconf option --without-x. If DBUS_ENABLE_X11_AUTOLAUNCH is *also* defined, dbus-launch and libdbus will be willing to perform autolaunch. Again, most distributors will want this, but it can be disabled with --disable-x11-autolaunch. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19997 Reviewed-by: Colin Walters <walters@verbum.org>
* | Merge branch 'dbus-1.4'Simon McVittie2011-05-253-16/+1
|\ \ | |/
| * handle_server_data_anonymous_mech: remove unnecessary debug outputSimon McVittie2011-05-251-12/+0
| | | | | | | | | | | | | | | | | | | | | | Doing a malloc and a hex-encoding pass just to produce a _dbus_verbose message (i.e. a message that, in practice, nobody will see) seems like overkill, and this block had incorrect error handling (not checking the result of _dbus_string_init) which upsets static analysis tools. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29881 Bug-NB: NB#180486 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
| * dbus_connection_dispatch: remove dead codeSimon McVittie2011-05-251-3/+0
| | | | | | | | | | | | | | | | | | There's no way pending can be non-NULL here; if it was, we'd have jumped straight past this block (getting filters from the connection), because replies to pending calls don't go through filters. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33128 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
| * DBusNonceFile: don't always fail when use_subdir=TRUE, i.e. on UnixSimon McVittie2011-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In shell-like pseudocode, the desired result is: if $use_subdir dir = $tmpdir/dbus_nonce-$random path = $dir/nonce mkdir $dir write file at $path else dir = $user_owned_place path = $dir/dbus_nonce-$random write file at $path However, /nonce was accidentally appended to $dir instead of $path, resulting in an attempt to mkdir /tmp/dbus_nonce-XXXX/nonce when dbus_nonce-XXXX hadn't been created yet. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34569 Tested-by: David Zeuthen <davidz@redhat.com> Reviewed-by: David Zeuthen <davidz@redhat.com>
* | Merge branch 'dbus-1.4'Simon McVittie2011-05-031-1/+1
|\ \ | |/
| * dbus_connection_can_send_type: clarify that invalid codes are allowed hereSimon McVittie2011-05-031-1/+1
| | | | | | | | | | | | | | This is sufficiently unusual that it seems worth saying explicitly Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35182 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
* | Merge branch 'dbus-1.4'Simon McVittie2011-04-273-17/+101
|\ \ | |/
| * machine-id: fall back to reading /etc/machine-id if D-Bus machine ID is not ↵Lennart Poettering2011-04-271-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | available Newer systemd-based systems support a global machine ID with the same metrics as the D-Bus machine ID, but more powerful semantics (for example on ro media) in /etc/machine-id. If the D-Bus machine ID cannot be read, fall back to the systemd machine ID. This is a first step towards allowing D-Bus to be started up during early boot where /var is not available. [plus a whitespace fix -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Colin Walters <walters@verbum.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35228
| * _dbus_check_fdleaks_enter, _dbus_check_fdleaks_leave: whitespaceSimon McVittie2011-04-271-12/+12
| | | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35173 Reviewed-by: Colin Walters <walters@verbum.org>
| * Don't report file descriptors as "leaked" if they were already openSimon McVittie2011-04-272-9/+82
| | | | | | | | | | | | | | | | This is necessary to run the regression tests under valgrind (if telling it to output to a dedicated fd), gdb, fakeroot etc. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35173 Reviewed-by: Colin Walters <walters@verbum.org>
* | Merge branch 'dbus-1.4'Simon McVittie2011-04-261-4/+6
|\ \ | |/ | | | | | | Conflicts: NEWS
| * Don't force use of -fPIE for the dbus-daemon if apparently supportedSimon McVittie2011-04-261-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a minor security benefit, but not automatically beneficial (it enables ASLR, but breaks prelinking, some buggy toolchains, and some gdb versions). Distributions who know their infrastructure works well can enable it just as easily via ./configure CFLAGS="-fPIE" LDFLAGS="-pie" without extra support from us, and that's a generic solution applicable to many packages. Similarly, don't force libdbus and libdbus-internal to be PIC: libtool knows better than we do whether that's necessary/beneficial on a particular platform. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=16621 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27215 Bug-NB: NB#171940 Reviewed-by: Colin Walters <walters@verbum.org>
| * Revert merge of master (dbus-1.5) into dbus-1.4Simon McVittie2011-03-149-172/+64
| | | | | | | | | | This reverts commits d1d395774435..09c9d6406b75f, keeping Lennart's addition of UnknownInterface etc.
* | dbus_bus_add_match: improve error documentation.Will Thompson2011-04-141-3/+9
| | | | | | | | | | It's simply not true that the only possible error is a lack of resources in the bus.
* | Merge remote-tracking branch 'wjt/arg0namespace' into arg0namespace-24317Simon McVittie2011-04-072-18/+51
|\ \
| * | Validate arg0namespace matches' values.Will Thompson2010-11-232-18/+51
| | | | | | | | | | | | | | | I could be convinced that this is overkill, but it seems sensible to forbid obviously-broken arg0namespace matches.
* | | connection: hook UnknownObject and UnknownInterface up where appropriateLennart Poettering2011-03-113-5/+12
| |/ |/| | | | | | | | | | | | | This makes use of UnknownInterface and UnknownObject where appropriate in the D-Bus core. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34527 Reviewed-By: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | protocol: introduce four new errorsLennart Poettering2011-03-101-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Make dbus_type_is_valid into public APISimon McVittie2011-03-107-49/+56
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'dbus-1.4'Simon McVittie2011-03-105-13/+62
|\ \
| * | _dbus_marshal_write_fixed_multi: remove obsolete FIXME commentSimon McVittie2011-03-101-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | dbus_message_iter_append_basic: remove misleading documentationSimon McVittie2011-03-101-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Merge branch 'validate-when-sending-16338' into dbus-1.4Simon McVittie2011-03-103-0/+52
| |\ \ | | | | | | | | | | | | Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
| | * | dbus_message_iter_append_fixed_array: add a check for valid booleansSimon McVittie2011-03-041-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * | dbus_message_iter_append_basic: validate booleans tooSimon McVittie2011-03-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * | dbus_message_iter_append_basic: check string-like arguments for validitySimon McVittie2011-03-043-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | dbus_type_is_basic etc.: it is an error to pass in bad typecodesSimon McVittie2011-03-101-7/+10
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'dbus-1.4'Simon McVittie2011-02-251-0/+23
|\ \ \ | |/ / | | | | | | | | | Conflicts: NEWS
| * | Allow X11 autolaunch to be disabled even if the headers/libraries are thereSimon McVittie2011-02-241-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Don't attempt Unix X11 autolaunching if DISPLAY isn't setSimon McVittie2011-02-241-0/+12
| | | | | | | | | | | | | | | | | | | | | 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
* | | Merge branch 'dbus-1.4'Simon McVittie2011-02-241-23/+26
|\ \ \ | |/ /
| * | Give XDG_DATA_HOME priority over XDG_DATA_DIRS for servicedirsSimon McVittie2011-02-241-23/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Improved dbus_string_replace_len()Roberto Guido2011-02-182-15/+116
|/ / | | | | | | | | | | Reviewed-by: Havoc Pennington <hp@pobox.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=21261
* | sysdeps-win needs _dbus_path_is_absoluteMark Brand2011-02-182-17/+17
| | | | | | | | Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | Merge branch 'leak-fixes-33126'Simon McVittie2011-02-171-11/+3
|\ \ | | | | | | | | | | | | Reviewed-by: Colin Walters <walters@verbum.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33126
| * | DBusTransport: don't copy DBusAuth's GUID to expected_guidSimon McVittie2011-02-161-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was previously a leak in _dbus_transport_get_is_authenticated, if we hit OOM when copying the server's actual GUID. This would fail the "SHA1 connection test" if _dbus_iterate was modified to allocate and free one extra pointer per iteration. Rather than adding OOM handling everywhere, if we avoid strdup'ing the GUID, and just re-fetch the const string from the DBusAuth object on demand instead, we go back to a situation where _dbus_transport_get_is_authenticated can't fail. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33126
* | | Don't distribute dbus-arch-deps.h in the tarballSimon McVittie2011-02-171-3/+2
| | | | | | | | | | | | | | | | | | | | | It's generated by configure and specific to a system, so there's no point. Reviewed-by: Colin Walters <walters@verbum.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34292