Commit graph

3157 commits

Author SHA1 Message Date
Ralf Habacker
c4e5c2ec7a added notes about supported compilers 2011-12-21 08:50:08 +01:00
Ralf Habacker
61760cf7de made session service dirs customizable: autotools part 2011-11-21 12:21:10 +01:00
Ralf Habacker
89e453216c made session service dirs customizable: cmake part 2011-11-21 12:21:01 +01:00
Simon McVittie
a2c623b881 Merge branch 'dbus-1.4' 2011-11-02 15:31:09 +00:00
Simon McVittie
a36d4918a6 corrupt test: compile successfully against older GLib (Debian stable)
We don't really need g_socket_send_with_blocking here.

Also, don't leak the GLib socket objects.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41219
Reviewed-by: Lennart Poettering <lennart@poettering.net>
2011-11-02 15:20:51 +00:00
Simon McVittie
c587e56b8a Set DBUS_TEST_HOMEDIR when running installcheck
This avoids spamming ~/.dbus and ~/.dbus-keyrings with filesystem activity
while running the tests.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41218
Reviewed-by: Lennart Poettering <lennart@poettering.net>
2011-11-02 15:19:54 +00:00
Simon McVittie
ec350d8d06 _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>
2011-11-02 15:19:30 +00:00
Ralf Habacker
2214ad00c3 Merge branch 'dbus-1.4' 2011-10-28 21:41:55 +02:00
Ralf Habacker
93e9941de6 Optimized error handling of previous patch 2011-10-28 21:22:53 +02:00
Jesper Dam
d52b86d3e7 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.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41558
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2011-10-28 21:01:02 +02:00
Ralf Habacker
797b511deb Install empty session.d config directory using cmake, otherwise dbus-daemon will not start
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41319
2011-10-17 15:45:49 +02:00
Simon McVittie
301fa555ac cmake: don't include -util sources in the shared library
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34976
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-10-12 18:14:51 +01:00
Simon McVittie
617eaa9ef9 Remove dbus-auth-script from the shared library
Only the tests use this.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34976
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-10-12 18:14:09 +01:00
Ralf Habacker
7973504156 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
2011-09-29 14:08:03 +02:00
Simon McVittie
c141af6147 Remove EXT variable from CMake, just use Automake-compatible EXEEXT
According to Ralf, there's no standard name for this in CMake, so we
might as well use the standard Automake name.

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
2011-09-28 19:01:15 +01:00
Simon McVittie
be6ec7b22a 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
2011-09-28 19:01:04 +01:00
Simon McVittie
e9f0378bbf 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
2011-09-28 19:00:56 +01:00
Simon McVittie
2f2618294d cmake: remove unused TEST_SERVICE_DIR variable
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
2011-09-28 19:00:54 +01:00
Simon McVittie
33c43947cd Simplify substitution of test executables to use fewer variables
Also use EXEEXT in all the service files, even in the automake build
system.

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
2011-09-28 19:00:49 +01:00
Simon McVittie
6934bc6927 Simplify generation of bus configuration files
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
2011-09-28 19:00:11 +01:00
Ralf Habacker
ba033709b5 Merge branch 'dbus-1.4' 2011-09-24 08:35:49 +02:00
Ralf Habacker
ff3f4860ef Use dbus/dbus-arch-deps.h.in as source for cmake too
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41033
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-09-23 15:38:12 +02:00
Ralf Habacker
443b8ec3da Merge branch 'dbus-1.4'
Conflicts:
	cmake/CMakeLists.txt
2011-09-22 21:26:43 +02:00
Ralf Habacker
1767840160 Added cmake 'help-options' target to print out all available configure options
cherry-picked 5a0c5663eb
2011-09-22 20:32:42 +02:00
Ralf Habacker
37a81fc981 fixed cmake error: doc says CACHE needs type *and* doc string
cherry-picked aba867f242
2011-09-22 20:27:59 +02:00
Ralf Habacker
2f3403c37b Limit batch file creating to windows
cherry-picked 84b03cae58
2011-09-22 20:27:58 +02:00
Ralf Habacker
b49e278667 Fixed cmake buildsystem - option command only supports boolean values
Conflicts:

	cmake/CMakeLists.txt

cherry picked 4ee7b07b20 from master
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-09-22 20:03:48 +02:00
Ralf Habacker
e41d163083 cmake fix: generate build timestamp
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41029
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-09-22 19:55:13 +02:00
Ralf Habacker
692baa9d6a Simplified cmake xml parser dependencies.
Find either expat or libxml2 xml parser libraries, depending on -DDBUS_USE_EXPAT=ON|OFF

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41027
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-09-22 19:33:32 +02:00
Simon McVittie
8acd2e2148 Micro version 2011-09-21 19:39:18 +01:00
Simon McVittie
e24b3f1dba Prepare version 1.5.8 2011-09-21 18:26:29 +01:00
Simon McVittie
6bded84c40 Merge branch 'dbus-1.4'
Conflicts:
	NEWS
	configure.ac
2011-09-21 18:21:09 +01:00
Simon McVittie
337d9432f2 Micro version 2011-09-21 18:14:39 +01:00
Simon McVittie
7dbfa45153 Prepare version 1.4.16 2011-09-21 15:26:53 +01:00
Simon McVittie
cc5404cfa6 Enable more compiler warnings by default
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:56:28 +01:00
Simon McVittie
0db406cb19 refs test: fix unused variable
This one was added since my more-unused-39231 branch.
2011-09-21 11:56:28 +01:00
Simon McVittie
87d37f0867 Fix compilation of syslog test in master 2011-09-21 11:56:28 +01:00
Simon McVittie
b3b9fc03da Merge branch 'more-unused-39231'
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:45:13 +01:00
Simon McVittie
44f2531016 Merge branch 'remove-stub-tests-41012'
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41012
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:44:38 +01:00
Simon McVittie
bf3d8259ac Merge branch 'dbus-1.4'
Conflicts:
	NEWS
2011-09-21 11:39:32 +01:00
Simon McVittie
bdfec55054 NEWS 2011-09-21 11:38:22 +01:00
Simon McVittie
423ab7cdd0 update_desktop_file_entry: initialize return value properly, and actually return it
Since 1.4.4 (commit 75cfd97f) this function always returned FALSE. As far
as I can see this was actually harmless, because both of its callers
ignore any error that is not NoMemory (and treat it the same as success).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39230
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:34:31 +01:00
Simon McVittie
c38e9823da update_desktop_file_entry: if the service name already existed, set error
If we're going to return FALSE for this (which has apparently always
been the case), then we should set an error properly.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39230
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:34:07 +01:00
Simon McVittie
9e93d82862 update_desktop_file_entry: don't leak file_path on one particular OOM
Revenge of #33126: most, but not all, temporary variables were freed on
this code path.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39230
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:33:38 +01:00
Simon McVittie
4dd6abc953 NEWS 2011-09-21 11:25:48 +01:00
Simon McVittie
dc632829db If --enable-tests=yes, require Python modules for complete test coverage
The two relevant tests already exit 0 with a message if importing those
modules fails.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37847
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:25:48 +01:00
Simon McVittie
3f1af382a1 Only ask pkg-config for the systemd unit directory if both are installed
pkg-config is not a hard dependency, and this check avoids errors in a
minimal build environment:

./configure: line 21777: --variable=systemdsystemunitdir: command not found

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37847
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:25:48 +01:00
Simon McVittie
d55b3efbde Give better diagnostics if --enable-tests=yes is given
We want to indicate why it's a problem that GLib, dbus-glib are missing.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37847
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:25:48 +01:00
Simon McVittie
5defa43b6f Check for Python; skip Python tests if not found
As with the optional test-dependencies on GLib and dbus-glib, we make this
a hard dependency if --enable-tests[=yes], but not if --enable-tests=auto.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37847
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:25:48 +01:00
Simon McVittie
7fc9c02666 Cope with platforms whose vsnprintf violates both POSIX and C99
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=11668
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:25:48 +01:00