Simon McVittie [Thu, 12 May 2011 12:01:32 +0000 (13:01 +0100)]
dbus_message_cache_or_finalize: allow message cache to be disabled at runtime
This should make it easier to diagnose message-related ref leaks,
use-after-free, etc. with Valgrind: for optimal results (and pessimal
performance), we want to avoid re-using memory blocks for as long as
possible.
For now this is conditional on DBUS_BUILD_TESTS. It could get its own
conditional if desired.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37286 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
Simon McVittie [Thu, 12 May 2011 11:56:22 +0000 (12:56 +0100)]
DBusMemPool: inform valgrind what we're up to
If we tell valgrind what we're doing, it can give better diagnostics.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37286 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
Simon McVittie [Mon, 13 Feb 2012 17:53:51 +0000 (17:53 +0000)]
Add support for inserting (a subset of) Valgrind client requests
If valgrind support is disabled, we define stub versions of the
Valgrind client requests I plan to use, so the actual code doesn't
need #ifdef hell.
[With unnecessary AC_SUBST removed as per Lennart's review -smcv]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37286 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
They're unused, except by their own regression tests.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39759 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
These are unused (except by their regression test!) and not visible to
external callers.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39759 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
Simon McVittie [Fri, 10 Feb 2012 14:32:01 +0000 (14:32 +0000)]
_dbus_list_pop_last_link: remove, unused
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39759 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39759 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39759 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
Simon McVittie [Wed, 22 Jun 2011 15:05:18 +0000 (16:05 +0100)]
_dbus_list_insert_before: remove, unused
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39759 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
Simon McVittie [Wed, 22 Jun 2011 15:05:08 +0000 (16:05 +0100)]
_dbus_header_field_to_string: remove, unused
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39759 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39759 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
Simon McVittie [Tue, 2 Aug 2011 11:55:09 +0000 (12:55 +0100)]
_dbus_getgid: remove, unused
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39759 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
bus: introduce --nopidfile switch to disable writing of PID files
When used with init systems such as systemd (where PID files are
redundant) this allows us to disable PID files even if a path is
configured for them in the normal bus configuration files.
Make use of this new switch in the systemd unit file.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45520 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Simon McVittie [Mon, 6 Jun 2011 16:40:41 +0000 (17:40 +0100)]
dbus-marshal-recursive: make some internal functions static
Having a disabled type writer, comparing type readers by position, and
performing a single step of copying from a reader to a writer all seem pretty
obscure, and were only used within dbus-marshal-recursive.c (to realign
after insertion).
Jack Nagel [Fri, 16 Dec 2011 06:21:21 +0000 (00:21 -0600)]
docs: correctly invoke man2html
man2html expects to find its input on stdin, so just passing the
filename will cause it to hang waiting for input.
[man2html 1.6g as shipped in Debian seems to be fine with files on the
command line, but apparently other versions aren't? -smcv]
Signed-off-by: Jack Nagel <jacknagel@gmail.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=43875
Simon McVittie [Wed, 8 Feb 2012 16:11:35 +0000 (16:11 +0000)]
Explicitly don't search XDG_DATA_DIRS for system services, and document it
In practice, it never works, because the activation helper doesn't
respect environment variables for security reasons.
If you want to vary the search path, alter system.conf instead, to
replace or augment <standard_system_servicedirs/> with your preferred
search path.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=21620 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
systemd: drop machine UUID generation for unit file
To optimize startup a bit, drop machine UUID generation from the unit
file. Since a while D-Bus was already capable of making use of the
/etc/machine-id file, which is guaranteed to exist on systemd systems
(since the first released versions already), hence there's no need to
ever generate a D-Bus specific machine ID.
In times where userspace takes < 800ms to boot up getting rid of this
process optimizes boot time further.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45520 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
at_console: ask systemd whether a user is at the console
systemd manages seats and users. This patch optionally asks systemd
whether a user is at the console. It used libsystemd-login for that, a
low-level library that allows querying this kind of information without
expensive round trips.
In order to be nice to the Debian folks this patch falls back to
traditional modes of operation if systemd is not found to be around.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39609 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Simon McVittie [Mon, 23 Jan 2012 11:11:24 +0000 (11:11 +0000)]
Port to glib 2.31.x g_thread API
g_thread_init() is deprecated since glib 2.24, call g_type_init() instead.
Bump glib requirement accordingly.
g_thread_create is deprecated since 2.31, use g_thread_new() instead. When
building with a glib earlier than 2.31, provide a backwards compatibility shim.
[Added a comment about why we're using g_type_init() in a test that
doesn't otherwise use GObject -smcv]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=44413 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Someone seems to have merged part of master into 1.4. Again. Let's go
back to the "last known good" point (the branch-point of some 1.4
branches I had locally), then we can cherry-pick the changes that
should have gone in.
Simon McVittie [Thu, 3 Feb 2011 17:59:07 +0000 (17:59 +0000)]
_dbus_listen_tcp_socket: avoid leaking listen_fd in unlikely circumstances
If getaddrinfo (with port == 0) succeeds, the kernel gives us a port when
we first listen on a socket, we jump back to redo_lookup_with_port,
and getaddrinfo (with the nonzero port) fails, we leak listen_fd and all
the fds in it.
From the department of "without static analysis we'd never have spotted
this", or possibly "backward goto considered harmful".
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29881
Bug-NB: NB#180486 CID-2389 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Jesper Dam [Fri, 28 Oct 2011 13:54:30 +0000 (15:54 +0200)]
Find dbus-daemon executable next to dbus shared libaray on windows.
If the dbus shared library and the daemon executable are both in a dir
that is not part of the default search path and dbus-1.dll is dynamically
loaded with LoadLibrary(), it will fail to locate and launch the daemon
without this patch.
Merged cmake and autotools session bus configuration
cmake and autotools session bus configuration templates are identical,
so cmake now uses the autotools. Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41319
Simon McVittie [Mon, 26 Sep 2011 11:35:07 +0000 (12:35 +0100)]
sysdeps: remove misleading comments
The comment claims that _dbus_full_duplex_pipe() is only used for
the debug-pipe server, but in fact the process-spawning code uses it now
(on both Unix and Windows platforms).
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41222
Simon McVittie [Mon, 26 Sep 2011 16:37:20 +0000 (17:37 +0100)]
Merge tests' cmake and autotools bus configuration
In Unix, the tests listened on both debug-pipe (which is a socketpair,
or a TCP emulation of socketpair on Windows) and a Unix socket.
In the Windows port, the tests were hard-coded to listen on a particular
port, which allowed the dispatch test to connect to that port, as long
as no two tests ran simultaneously (which I don't think was ever guaranteed -
make -j can violate this). That's valid out-of-process, and also
fully-specified, so they only needed one <listen> directive, so the
CMake input only had one.
To make the tests work under CMake on Unix, there was a hack: the string
substituted for the content of the <listen> directive contained
</listen><listen> to get the other address in, which is pretty nasty.
Instead of doing that, I've made both build systems, on both Unix and
Windows, use both debug-pipe and a more normal transport (Unix or TCP).
debug-pipe has a Windows implementation and it's used in
dbus-spawn-win.c, so it'd better work. The use of debug-pipe is now
hard-coded rather than being a configure parameter (there's no reason
to vary it in different builds), and I used TEST_LISTEN as the name of the
Unix/TCP address, because it's a "vague" address (no specific Unix path, no
TCP port), that you can listen on but not connect to.
This in turn means that we can merge the Autoconf .in and CMake .cmake
files, similar to Bug #41033.
You might wonder why I've kept debug-pipe. I did try to get rid of it, but
it turns out that the tests in dispatch.c rely on
dbus_connection_open_private() not blocking, and normal socket
connections block on connect(). Until we fix that by adding an async
version of dbus_connection_open_private(), it won't be safe to have a
test like dispatch.c that "talks to itself", unless it uses a transport
as trivial as debug-pipe in which neither end has to block on the other.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41222