summaryrefslogtreecommitdiff
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* Add versioned symbol support to cmake build system for linux platforms to ↵Simon McVittie2015-02-201-0/+7
| | | | | | | keep in sync with autotools. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83115 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* cmake: check for the necessary symbols for test-segfault.cSimon McVittie2015-02-201-0/+3
| | | | | | | | | | | | If we don't check for them, and you have core dumps enabled, then running this test under cmake is really annoying, because it leaves lots of core dumps none of which are actually a problem. The equivalent Autotools change (which added the actual code that this relies on) is commit ae50d46, from fd.o#83772. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83115 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* Link dbus-daemon and dbus-daemon-lauch-helper against libdbusBertrand SIMONNET2015-02-202-12/+2
| | | | | | | | | | | | | | The shared can be used by dbus-daemon and dbus-daemon-launch-helper by exporting the private symbols needed, reducing the size of dbus by about 500k. The private symbols are exposed under the version LIBDBUS_PRIVATE_@VERSION_NUMBER@. [Altered by Simon McVittie and Ralf Habacker to clear up some problematic linking.] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83115 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* tests: always use libdbus-internal for main loop, never dbus-glibSimon McVittie2015-02-201-1/+1
| | | | | | | | | | This gets rid of a potential circular dependency, which is annoying when bootstrapping. It is nice to have the regression tests use the shared libdbus, but we're about to make it possible to do that anyway, even though some of them use internal symbols. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83115 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* Add apparmor element support to bus config parsingTyler Hicks2015-02-181-0/+2
| | | | | | | | | | | | | | | | | | | The <apparmor> element can contain a single mode attribute that has one of three values: "enabled" "disabled" "required" "enabled" means that kernel support is autodetected and, if available, AppArmor mediation occurs in dbus-daemon. If kernel support is not detected, mediation is disabled. "disabled" means that mediation does not occur. "required" means that kernel support must be detected for dbus-daemon to start. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75113 Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-send: Keep cmake build system in sync with autotools.Ralf Habacker2015-02-161-0/+2
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89109 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Add manual-paths test executable with cmake build support.Ralf Habacker2015-02-123-0/+10
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83539 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Add dbus-test-tool and its man page to the CMake build systemSimon McVittie2015-02-122-0/+16
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89086 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* Add a common test_init() for GLib tests which prevents hanging foreverSimon McVittie2015-02-041-1/+1
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* dbus-monitor: add options to log binary data with or without pcap framingSimon McVittie2015-02-041-0/+2
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* Provide appropriate DBUS_USER and DBUS_TEST_USER under CMakeRalf Habacker2015-02-042-3/+6
| | | | | | [separated out from a larger commit -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88964 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Link tests to test-utils-glib.c under CMake tooRalf Habacker2015-02-041-1/+9
| | | | | | [Separated out from a larger commit -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88964 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-monitor: use common code from dbus-test-toolSimon McVittie2015-02-041-0/+2
| | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall [also sync up the cmake build system -smcv]
* Add manual tcp test case.Ralf Habacker2015-01-301-0/+5
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Fix usage of undefined variable DBUS_WIN32 on cmake build systemRalf Habacker2015-01-051-1/+1
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88010 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Merge branch 'dbus-1.8'Ralf Habacker2015-01-052-1/+5
|\ | | | | | | | | | | Conflicts: NEWS configure.ac
| * Windows cmake cross compile fixRalf Habacker2015-01-051-1/+1
| | | | | | | | | | | | | | We need to include 'test' subdir in any case not only when using glib. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88009 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
| * Fix of 'dbus-daemon can only handle 64 simultaneous connections on Windows'.Ralf Habacker2015-01-051-0/+4
| | | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71297 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | Include test-dbus and test-bus in cmake 'make check' target.Ralf Habacker2014-10-242-4/+3
| | | | | | | | | | | | | | | | Because test-dbus and test-bus lives in subdirectory dbus/bus, we need to define make 'check' in top level source directory. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73689 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | cmake: only copy session.conf and system.conf into test data dirSimon McVittie2014-10-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | Historically, CMake used the glob *.conf.in whereas Autotools listed the files explicitly. This used to be equivalent, but broke down when we added example-*.conf.in which are just snippets rather than complete configuration files (they're intended to go in session.d or system.d, or otherwise get included by the main config file). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73689 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | Add configure checks for accept4, dirfd, inotify_init1 and unix_fd_passing ↵Ralf Habacker2014-10-242-0/+9
| | | | | | | | | | | | | | to cmake build system. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73689 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | Add configure check for pipe2 to cmake build system.Ralf Habacker2014-10-172-0/+5
| | | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73689 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | Build test-bus-system with cmake on non win32 platforms.Ralf Habacker2014-09-181-1/+15
| | | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83583 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | Merge branch 'dbus-1.8'Simon McVittie2014-09-162-6/+0
|\ \ | |/ | | | | | | | | Conflicts: NEWS configure.ac
| * config: change DEFAULT_MESSAGE_UNIX_FDS to 16Simon McVittie2014-09-152-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses CVE-2014-3636. Based on a patch by Alban Crequy. Now that it's the same on all platforms, there's little point in it being set by configure/cmake. This change fixes two distinct denials of service: fd.o#82820, part A ------------------ Before this patch, the system bus had the following default configuration: - max_connections_per_user: 256 - DBUS_DEFAULT_MESSAGE_UNIX_FDS: usually 1024 (or 256 on QNX, see fd.o#61176) as defined by configure.ac - max_incoming_unix_fds: DBUS_DEFAULT_MESSAGE_UNIX_FDS*4 = usually 4096 - max_outgoing_unix_fds: DBUS_DEFAULT_MESSAGE_UNIX_FDS*4 = usually 4096 - max_message_unix_fds: DBUS_DEFAULT_MESSAGE_UNIX_FDS = usually 1024 This means that a single user could create 256 connections and transmit 256*4096 = 1048576 file descriptors. The file descriptors stay attached to the dbus-daemon process while they are in the message loader, in the outgoing queue or waiting to be dispatched before D-Bus activation. dbus-daemon is usually limited to 65536 file descriptors (ulimit -n). If the limit is reached and dbus-daemon needs to receive a message with a file descriptor attached, this is signalled by recvfrom with the flag MSG_CTRUNC. Dbus-daemon cannot recover from that error because the kernel does not have any API to retrieve a file descriptor which has been discarded with MSG_CTRUNC. Therefore, it closes the connection of the sender. This is not necessarily the connection which generated the most file descriptors so it can lead to denial-of-service attacks. In order to prevent DoS issues, this patch reduces DEFAULT_MESSAGE_UNIX_FDS to 16: max_connections_per_user * max_incoming_unix_fds = 256 * 64 = 16384 This is less than the usual "ulimit -n" (65536) with a good margin to accomodate the other sources of file descriptors (stdin/stdout/stderr, listening sockets, message loader, etc.). Distributors on non-Linux may need to configure a smaller limit in system.conf, if their limit on the number of fds is smaller than Linux's. fd.o#82820, part B ------------------ On Linux, it's not possible to send more than 253 fds in a single sendmsg() call: sendmsg() would return -EINVAL. #define SCM_MAX_FD 253 SCM_MAX_FD changed value during Linux history: - it used to be (OPEN_MAX-1) - commit c09edd6eb (Jul 2007) changed it to 255 - commit bba14de98 (Nov 2010) changed it to 253 Libdbus always sends all of a message's fds, and the beginning of the message itself, in a single sendmsg() call. Combining these two, a malicious sender could split a message across two or more sendmsg() calls to construct a composite message with 254 or more fds. When dbus-daemon attempted to relay that message to its recipient in a single sendmsg() call, it would receive EINVAL, interpret that as a fatal socket error and disconnect the recipient, resulting in denial of service. This is fixed by keeping max_message_unix_fds <= SCM_MAX_FD. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82820 Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
* | Fix installation of empty directories for cmake build system.Ralf Habacker2014-09-153-12/+20
| | | | | | | | | | | | | | | | | | | | The differences has been found out by comparing with the cross compiled mingw..-dbus packages. [exclude system bus support bits on Windows -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83583 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | Make various system-bus-related things Unix-onlySimon McVittie2014-09-151-7/+2
| | | | | | | | | | | | | | | | There is no system bus on Windows, and there won't be until/unless it can be secure. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83583 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | Add directory test application 'manual-dir-iter' to cmake and autotools ↵Ralf Habacker2014-09-081-0/+5
| | | | | | | | | | | | | | build system. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57272 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | Win32 cmake msvc16 64 bit native and mingw32/64 4.8.3 cross compile fix.Ralf Habacker2014-08-081-0/+2
| | | | | | | | | | | | | | | | This patch fixes a "missing include directory" compile error on test-print build target. Bug: http://lists.freedesktop.org/archives/dbus/2014-August/016260.html Reviewed-by: rony@wu.ac.at Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | Make documentation generating MSYS/MSYS2-compatibleРуслан Ижбулатов2014-03-201-0/+15
| | | | | | | | | | | | | | | | | | | | | | xmlto is a shell script, it needs to be fed MSYSsy filenames. This patch adds a cygpath invocation for filename conversion (autotools do that automatically, for CMake you have to spell it out). Cygwpath is available in MSYS2 (and Cygwin, obviously). When cygpath is not available, use MSYS-specific pwd extension to get W32 path. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75860 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | Only support systemd: transport if we have systemd librariesSimon McVittie2014-02-191-2/+0
| | | | | | | | | | | | | | | | | | This means we can drop our convenience copy of sd-daemon.[ch]. We're checking for libsd-daemon anyway, to support journald and logind integration. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71818 Reviewed-by: Lennart Poettering <lennart@poettering.net>
* | Keep cmake generated shared dbus-1 library file name in sync with autotools.Ralf Habacker2014-01-303-2/+22
|/ | | | | | | | | | | Autotools uses a versioned shared library name derived from libtool. This patch adds a versioned shared library name to cmake builds for all supported platforms. Binary compatibility for clients build against older cmake generated binary packages of dbus is provided; on unix like os with symbolic links and on Windows with a copy of the shared library. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=74117 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Fix of 'dbus-daemon can only handle 64 simultaneous connections on Windows'.Cristian Onet2014-01-272-0/+6
| | | | | | | | [Slightly modified by -rh] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71297 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Give cmake users some hints/requirements when cross compiling for Windows on ↵Ralf Habacker2014-01-212-0/+31
| | | | | | | Linux. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Let cmake 'make check' run test applications as test group.Ralf Habacker2014-01-171-11/+1
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Rename bus-test-launch-helper to test-bus-launch_helper to match common test ↵Ralf Habacker2014-01-171-2/+2
| | | | | | | application naming scheme. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Rename bus-test to test-bus to match common test application naming scheme.Ralf Habacker2014-01-171-2/+2
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Rename spawn-test to test-spawn to match common test application naming scheme.Ralf Habacker2014-01-171-2/+2
| | | | | | | [Same change as for shell-test in the previous commit. -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Rename shell-test to test-shell to match common test application naming scheme.Ralf Habacker2014-01-171-3/+3
| | | | | | | | [Add its source file to SOURCES: this test was previously relying on the Automake feature that the default value of foo_bar_SOURCES is foo-bar.c. -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Rename dbus-test to test-dbus to match common test application naming scheme.Ralf Habacker2014-01-171-2/+2
| | | | | | [reverted the dbus-specification part -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* CMake warning--.Ralf Habacker2014-01-171-1/+1
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* tests: don't block and wait for a debugger on abortSimon McVittie2014-01-101-1/+0
| | | | | | | | | | In general, I think developers running the tests would expect them to terminate rather than hanging. Developers who want to debug such an abort by attaching a debugger to a live process can still set DBUS_BLOCK_ON_ABORT in the environment. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* Use macros for test and helper executable targets on cmake build system.Ralf Habacker2014-01-105-101/+61
| | | | | | | | | | | | | | | The new macros add_test_executables and add helper_executables provides a platform independent way for specifing dbus test and service applications. On native Windows and Linux/UNIX systems the test applications are directly runable. When cross compiling for Windows on Linux test applications could be executed on the Linux host system with the help of wine and activated binfmt_misc support for wine. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Add 'check' cmake target to keep in sync with autotools.Ralf Habacker2014-01-101-0/+14
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Create session.conf and system.conf for test/data/valid-config-files from ↵Ralf Habacker2014-01-101-2/+5
| | | | | | | | | *.in files on cmake. We need to patch the listen address. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Define TEST_BUS_LAUNCH_BINARY for cmake to keep in sync with autotools.Ralf Habacker2014-01-103-4/+2
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Use cmake build in executable suffix.Ralf Habacker2014-01-101-3/+2
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Remove obsolete cmake project tags in sub directories; we only have one project.Ralf Habacker2014-01-084-7/+0
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68506 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Add glib support to cmake buildsystem.Ralf Habacker2014-01-076-42/+186
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68506 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* cmake: fix code styleChengwei Yang2013-11-271-3/+3
| | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66453 Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>