summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-05-08[untested] add an automatically-initialized implementation of _dbus_lock on ↵thread-safe4Simon McVittie2-4/+32
Windows
2013-05-08Stop asserting that we're not using the dummy lock implementationSimon McVittie1-10/+0
That implementation no longer exists, so neither 0xABCDEF nor 0xABCDEF2 has any special meaning any more. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-05-08Add a statically-initialized implementation of _dbus_lock() on glibc systemsSimon McVittie3-0/+67
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
2013-05-08Always initialize threading before allocating a dynamic mutexSimon McVittie1-244/+56
Dynamic allocation of mutexes can fail anyway, so this is easy. Justification for not keeping the dummy mutex code-paths, even as an opt-in thing for processes known to be high-performance and single-threaded: real mutexes only cut the throughput of test/dbus-daemon.c by a couple of percent on my laptop (from around 6700 to around 6600 messages per second), and libdbus crashes caused by not calling dbus_threads_init_default() are sufficiently widespread that they're wasting a lot of everyone's time. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
2013-05-08Make taking a global lock automatically initialize locking if neededSimon McVittie14-71/+213
This lets them be thread-safe by default, at the cost that they can now fail. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
2013-05-08Replace individual global-lock variables with an array of DBusRMutex *Simon McVittie15-184/+126
This means we can use a much simpler code structure in data-slot allocators: instead of giving them a DBusRMutex ** at first-allocation, we can just give them an index into the array, which can be done statically. It doesn't make us any more thread-safe-by-default - the mutexes will only actually be used if threads were already initialized - but it's substantially better than nothing. These locks really do have to be recursive: for instance, internal_bus_get() calls dbus_bus_register() under the bus lock, and dbus_bus_register() can call _dbus_connection_close_possibly_shared(), which takes the bus lock. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-05-08Turn a runtime assertion into a compile-time assertionSimon McVittie1-2/+1
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
2013-05-08Remove unused global mutexes for win_fds, sid_atom_cacheSimon McVittie3-10/+4
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
2013-05-08dbus_threads_init_default, dbus_threads_init: be safe to call at any timeSimon McVittie9-7/+139
On Unix, we use a pthreads mutex, which can be allocated and initialized in global memory. On Windows, we use a CRITICAL_SECTION, together with a call to InitializeCriticalSection() from the constructor of a global static C++ object (thanks to Ralf Habacker for suggesting this approach). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
2013-05-08dbus_threads_init: call _dbus_threads_init_platform_specific()Simon McVittie3-5/+7
This reverses the relationship between these two functions. Previously, dbus_threads_init() wouldn't allocate dbus_cond_event_tls on Windows, call check_monotonic_clock on Unix, or call _dbus_check_setuid on Unix. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
2013-05-08DBusAtomic: on Unix, use pthreads mutexes for fallbackSimon McVittie4-17/+20
On pthreads platforms, POSIX guarantees that we can "allocate" mutexes as library-global variables, without involving malloc. This means we don't need to error-check their allocation - if the dynamic linker succeeds, then we have enough memory for all our globals - which is an important step towards being thread-safe by default. In particular, making atomic operations never rely on DBusMutex means that we are free to implement parts of DBusMutex in terms of DBusAtomic, if it would help. We do not currently support any non-Windows platform that does not have pthreads. This is unlikely to change. On Windows, we already used real atomic operations; we can just delete the unused global variable. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
2013-05-08Fix compiler warnings when X11 autolaunch and launchd are both disabledSimon McVittie2-1/+4
From the department of "if it isn't tested, it doesn't work". I tried compiling dbus without an assortment of optional features: in_builddir ~/build/dbus/legacy ${MR_REPO}/configure \ --enable-developer --enable-maintainer-mode --enable-tests \ dbus_cv_sync_sub_and_fetch=no \ --disable-selinux \ --disable-inotify \ --disable-dnotify \ --disable-epoll \ --disable-kqueue \ --disable-launchd \ --disable-systemd \ --disable-libaudit \ --without-valgrind \ --disable-x11-autolaunch \ && ... and it resulted in -Wunused warnings. The tests also fail with dbus_cv_sync_sub_and_fetch=no, but that's a separate issue. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64362 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-05-08Add _DBUS_GNUC_WARN_UNUSED_RESULT, similar to GLib'sSimon McVittie1-1/+9
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
2013-05-08NEWSSimon McVittie1-1/+5
2013-05-02start spec 0.22 developmentSimon McVittie1-2/+8
2013-05-02start 1.7.4 developmentSimon McVittie2-1/+6
2013-04-29Fixed cmake windows build system bug not installing runtime part of shared ↵Ralf Habacker2-1/+7
libraries into bin dir. This patch also take care of different install directories on unix like os. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59733 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-04-25prepare version 1.7.2 and spec 0.21Simon McVittie3-7/+10
2013-04-24Merge branch 'dbus-1.6'Simon McVittie0-0/+0
Conflicts: NEWS configure.ac
2013-04-24development versionSimon McVittie2-1/+6
2013-04-24Prepare release 1.6.10Simon McVittie2-3/+5
2013-04-23NEWS for 1.7Simon McVittie1-0/+1
2013-04-23Disable sd-daemon.c's support for POSIX message queuesSimon McVittie1-0/+4
This fixes build failures with recent glibc while avoiding an otherwise useless librt dependency. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63166 Reviewed-by: Thiago Macieira <thiago@kde.org>
2013-04-22NEWS for 1.7Simon McVittie1-4/+9
2013-04-22dbus.service.in: Do not order after syslog.targetCristian Rodríguez1-1/+0
It is no longer required or recommended in fact it no longer exists since http://cgit.freedesktop.org/systemd/systemd/commit/?id=5d4caf565471ff3401bd9b53aa814c8545a18a93 [Clarification: there are two reasons why we do not need that dependency. First, we do not have DefaultDependencies=no, so we only get run after sockets.target. Second, syslog.socket doesn't provide /dev/log, which is part of systemd-journald.socket. -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63531 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-04-22Specification: explicitly allow the Unicode noncharactersSimon McVittie1-2/+9
This follows Unicode Corrigendum #9. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63072 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-04-22Merge branch 'dbus-1.6'Simon McVittie3-11/+9
Conflicts: NEWS
2013-04-22NEWS for 1.6Simon McVittie1-0/+4
2013-04-22Accept non-characters when validating UnicodeSimon McVittie2-11/+5
Unicode Corrigendum #9 clarifies that the non-characters U+nFFFE (for n in the range 0 to 0x10), U+nFFFF (for n in the same range), and U+FDD0..U+FDEF are valid for interchange, and their presence does not make a string ill-formed. GLib 2.36 made the corresponding change in its definition of UTF-8 as used by g_utf8_validate() and similar functions. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63072 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-04-19Unify docbook dtd version to 4.4.Ralf Habacker4-8/+8
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59805 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-04-18NEWSSimon McVittie1-0/+3
2013-04-18Rename default_message_unix_fds to DEFAULT_MESSAGE_UNIX_FDSSimon McVittie4-7/+7
As Ralf pointed out, we usually use upper-case when substituting variables (apart from "somethingdir", which Autoconf conventionally makes lower-case for some reason). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63682 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-04-18cmake: define default_message_unix_fds so it can be substituted in session.confSimon McVittie2-1/+5
This fixes a regression since 1.7.0: session.conf would be invalid when generated by cmake. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63682 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-04-16sd-daemon.c: update from systemd for better portabilitySimon McVittie1-24/+11
2013-04-11NEWS for 1.7Simon McVittie1-0/+11
2013-04-11Set default maximum number of Unix fds according to OSMatt Fischer5-5/+18
QNX has an arbitrary limit to the number of file descriptors which may be passed in a message, which is smaller than the current default. This patch therefore changes the default from a hardcoded constant to a macro, which is determined at configure time by looking at the host operating system. [This reduces the limit from 4096 (session)/1024 (system) to 128 fds per message on QNX, and 1024 fds per message on other operating systems. I think the reduced session bus limit on other OSs is a reasonable change too, given that the default hard/soft ulimits in Linux are only 4096/1024 fds per process. -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61176 Reviewed-by: Simon McVittie <simon.mcvittie.collabora.co.uk>
2013-04-08Do not suppress syslog test's stderr just because init is systemdSimon McVittie5-8/+8
This causes the test to fail. The assumption implicitly being made was "if pid 1 is systemd, then every caller of _dbus_init_system_log() is a systemd service" which is not valid for the regression test. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63163 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Colin Walters <walters@verbum.org>
2013-04-05fix NEWS: a Windows "sid" is a security ID, not a session IDSimon McVittie1-4/+4
2013-04-05Merge branch 'dbus-1.6'Simon McVittie3-2/+7
Conflicts: NEWS configure.ac
2013-04-05NEWS for 1.7Simon McVittie1-0/+2
2013-04-05Allow use of GLib 2.32 functionality, which we do conditionallySimon McVittie1-1/+1
2013-04-05Don't warn for functions deprecated since GLib 2.26Simon McVittie1-0/+3
Also warn if we inadvertently use a function introduced since then. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59971 Reviewed-by: Colin Walters <walters@verbum.org>
2013-04-05NEWS for 1.6Simon McVittie1-0/+4
2013-04-05Don't access random memory if data slot isn't allocated yetDan Williams1-1/+2
If DBUS_DISABLE_ASSERTS was turned on, and a buggy program called dbus_connection_get_data() with a slot number less than zero (eg, before even allocating the data slot), random memory would be accessed and a random value returned. Anything less than zero is not a valid slot number and should be rejected by libdbus. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63127 Signed-off-by: Dan Williams <dcbw@redhat.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-04-05Add function _dbus_get_peer_pid_from_tcp_handle() which returns pid and sid ↵Ralf Habacker3-20/+130
from tcp connection peer. This function is called by _dbus_read_credentials_socket() to fetch client credentials. Because Wine is used to check cross compiled dbus for windows, in calls to GetExtendedTcpTable() we use table class TCP_TABLE_OWNER_PID_ALL instead of TCP_TABLE_OWNER_PID_CONNECTIONS. This class is the only one which is available since wine 1.5.3. https://bugs.freedesktop.org/show_bug.cgi?id=61787 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-04-03Merge branch 'dbus-1.6'Simon McVittie3-0/+19
2013-04-03NEWS for 1.6Simon McVittie1-0/+4
2013-04-03If alloca.h is available it is required (e.g. on Solaris 10)Dagobert Michelsen2-0/+5
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63071 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-04-03HAVE_DECL_LOG_PERROR is 0 when unavailableDagobert Michelsen1-1/+1
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39987 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-03-25Update sd-daemon.[hc] from upstreamMartin Pitt1-19/+16
This fixes sd_booted() to actually mean "have systemd init", which we need for _dbus_init_system_log() to decide whether systemd journal is being used. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=62585 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>