summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* dbus-monitor: add options to log binary data with or without pcap framingSimon McVittie2015-02-043-5/+185
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* dbus-monitor: add support for using BecomeMonitor to be a read-only monitorSimon McVittie2015-02-041-9/+75
| | | | | | | | | Move the dbus_connection_add_filter() call further up as a precaution, because it isn't safe for a monitor to not have a filter that swallows all messages. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* dbus-monitor: use common code from dbus-test-toolSimon McVittie2015-02-042-13/+10
| | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall [also sync up the cmake build system -smcv]
* lcov: use builddir, not srcdirSimon McVittie2015-02-021-2/+2
| | | | | | | | It seems lcov (or gcc?) has changed its paths since last time this worked. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88808 Reviewed-by: Philip Withnall
* dbus-test-tool: add black-hole modeAlban Crequy2014-10-143-32/+123
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34140 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-test-tool spam: add --messages-per-conn=NAlban Crequy2014-10-141-17/+77
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34140 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Add dbus-test-tool, currently with "echo" and "spam" modesAlban Crequy2014-10-148-0/+842
| | | | | | | | | | This is installed by default, but easy to filter out for embedded systems or whatever. Based on earlier work by Simon McVittie and Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34140 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* GetAllMatchRules: provide an example how it could be usedAlban Crequy2014-10-062-0/+117
| | | | | | | [use dist_examples_SCRIPTS instead of EXTRA_DIST -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=84598 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-monitor: more details on file descriptorsAlban Crequy2014-09-151-1/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Print more details when receiving a file descriptor. Before: unix fd 5 After: file descriptor inode: 1030 type: char file descriptor inode: 295664 type: socket address family: unknown (16) file descriptor inode: 295665 type: socket address family: inet name 127.0.0.1 port 47723 peer 127.0.0.1 port 22 file descriptor inode: 295666 type: socket address family: unix name @/tmp/d67s774Sws0pEra file descriptor inode: 295667 type: socket address family: unix name @ peer @ Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80603 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-monitor: do not leak file descriptors from fd-passingAlban Crequy2014-09-151-0/+7
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80603 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-launch: kill bus if we can't attach to a session when requestedРоман Донченко2014-06-111-1/+1
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=74698 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Avoid killing all available processes if an X error arrives early onРоман Донченко2014-04-301-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The timeline of events in dbus-launch's main process goes something like this: * do initial X calls [1] * do some other stuff * fork (child process starts doing some other stuff) * return "intermediate parent" pid from fork() * obtain bus daemon pid from bus_pid_to_launcher_pipe [2] * do things that might include X11 calls or killing the dbus-daemon Meanwhile, the "babysitter" child goes like this: * return 0 from fork() [3] * obtain bus daemon pid from parent process via bus_pid_to_babysitter_pipe [4] * do things that might include X11 calls or killing the bus daemon Before [1] or [3], the right thing to do about an X error is to just exit. The current implementation called kill(-1) first, which is undesirable: it kills unrelated processes. With this change, we just exit. After [2] or [4], the right thing to do is to kill the dbus-daemon, and that's what the existing code did. Between [1] and [2], or between [3] and [4], there is no correct thing that we can do immediately: we would have to wait for the end of the "critical section", *then* kill the dbus-daemon. This has not yet been implemented, so this patch relies for its correctness on the fact that there are no libX11 calls between those points, so we cannot receive an X error between them. dbus-launch deserves more comments, or a reimplementation that is easier to understand, but this change is certainly better than nothing. [Commit message added, summarizing reviewers' comments -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=74698 Reviewed-by: Simon McVittie Reviewed-by: Thiago Macieira
* Update .gitignore filesLukasz Skalski2014-03-061-0/+1
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75833 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Support printing unix file descriptors in dbus-send/dbus-monitorRobert Ancell2013-11-271-1/+9
| | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=70592 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-monitor: keep backwards compatibilityChengwei Yang2013-10-091-6/+25
| | | | | | | | | | | | | | | | eavesdropping as a match rule key introduced in DBus 1.5.6, and the privous implementation doesn't keep backwards compatibility with older dbus-daemon. And the reference dbus-daemon implementation just fail if unknwon key found in match rule, this is undefined hehavior in DBus Sepcification. Also there is a feature request for change this hehavior to "ignore unknown key in match rule", See https://bugs.freedesktop.org/show_bug.cgi?id=66114 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66107 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-send: replace --address with --peer and --bus.Andrey Mazo2013-10-091-6/+31
| | | | | | | | | | --peer is a direct substitute for --address. With --bus dbus-send registers on bus given by ADDRESS, thus allowing messages to be sent to the bus. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48816 [adjusted to apply to current master -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Revert "dbus-send: replace --address"... to fix attributionSimon McVittie2013-10-091-31/+6
| | | | This reverts commit 5b74af796c8f1d9f3f60594f22c6bfd4c097ad8b.
* Unify the way to find dbus-daemon test binaryChengwei Yang2013-10-081-29/+33
| | | | | | | | | | | | | | There are two ways to find the dbus-daemon for testing. The first one is defined as string at compile stage and the second one is export it from test environment. The first way has limitation that after defined, it's static string, so it's impossible to run installable check. So let's unify to the second way. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37849 [added missing "}" -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-send: replace --address with --peer and --bus.Simon McVittie2013-10-081-6/+31
| | | | | | | | | | --peer is a direct substitute for --address. With --bus dbus-send registers on bus given by ADDRESS, thus allowing messages to be sent to the bus. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48816 [adjusted to apply to current master -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-monitor: remove redundant match rulesChengwei Yang2013-10-081-16/+1
| | | | | | | | | | Currently, DBus Specification only consists of four message types, so to monitor all the types of message, no need to match all of them but just left it empty is OK. Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66107 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* When using dbus-launch for tests, fail hard if test binary is missingSimon McVittie2013-10-081-1/+2
| | | | | | | We want to test the version-under-test, not the system version. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37849 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
* dbus-launch: avoid asprintf(), and die gracefully on out-of-memorySimon McVittie2013-10-081-4/+28
| | | | | | | asprintf() is a GNU extension (non-portable). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37849 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
* Fix build on NetBSD 6.1.1 with gcc 4.5.3Chengwei Yang2013-10-082-1/+4
| | | | | | | | | | There are two build failure on NetBSD 6.1.1 with gcc 4.5.3, the first one is char to int, warning treated as error. The second one is a mismatch between format string and arguments. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69842 [adjusted commit message -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Fix an incorrect sizeof.Sviatoslav Chagaev2013-09-161-1/+1
| | | | | | | | | Fix an incorrect sizeof which leads to allocation of more memory than actually needed. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69329 [elide redundant "* sizeof (char)" which is 1 by definition -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Revert "Fix an incorrect sizeof." to fix attributionSimon McVittie2013-09-161-1/+1
| | | | This reverts commit 3c1938180bdca8fc658907f6f692186be2b81b77.
* Fix an incorrect sizeof.Simon McVittie2013-09-161-1/+1
| | | | | | | | | Fix an incorrect sizeof which leads to allocation of more memory than actually needed. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69329 [elide redundant "* sizeof (char)" which is 1 by definition -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Use test binaries in build dir to do testChengwei Yang2013-09-131-1/+9
| | | | | | | | | | | | | | | When do autolaunch testing, libdbus will try to start dbus-launch in installed direcotry, if fail then fall back to dbus-launch in $PATH. dbus-launch does a relative better thing to start dbus-daemon in build directory, however, in most of case, the build $prefix is different from the real prefix where dbus-daemon installed. So dbus-daemon will fail to start due to can't find its config file. And then dbus-launch will fall back to finally the installed dbus-daemon. This patch fix this behavior and will start dbus-launch and dbus-daemon in build directory in test environment. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37849
* dbus-launch: unconditionally use SIGHUP and free memory on OOMChengwei Yang2013-09-051-3/+5
| | | | | | | | | | | | | | In a previous patch, it check SIGHUP for windows, however, in fact there is dbus-launch-win.c supposed to be used on windows. So just use SIGHUP unconditionally. Also free memory on OOM, although this doesn't make much sense since this is a oneshort program, rather than a daemon. Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> [fixed whitespace -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66068 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* run-with-tmp-session-bus.sh: create a unique temporary file per processSimon McVittie2013-09-051-2/+9
| | | | | | | This makes the regression tests OK to run in parallel. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* dbus-run-session: remove various extra variables from the environmentSimon McVittie2013-08-232-22/+12
| | | | | | | | | | | | | | | DBUS_SESSION_BUS_PID is not mandatory to set, but we should unset it if present, since it points to a different session's bus. Likewise for DBUS_SESSION_BUS_WINDOWID. Similarly, if DBUS_STARTER_BUS_TYPE and DBUS_STARTER_ADDRESS are set (as they would be under GNOME Terminal 3.8, see <https://bugs.freedesktop.org/show_bug.cgi?id=63119>) then they are likely to point to a different session's bus. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39196 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Colin Walters <walters@verbum.org>
* Fixed compiler warning on windows.Ralf Habacker2013-08-191-2/+2
| | | | | https://bugs.freedesktop.org/show_bug.cgi?id=61874 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* tests to embedded tests: replaced in toolsChengwei Yang2013-06-281-2/+2
| | | | | | Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66291
* dbus-launch: do not verbose output if build with verbose mode disabledChengwei Yang2013-06-261-0/+2
| | | | | | Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66068
* dbus-launch: align documentChengwei Yang2013-06-261-1/+4
| | | | | | Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66068
* dbus-launch: fix coding styleChengwei Yang2013-06-261-17/+17
| | | | | | Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66068
* FreeBSD: explicit include signal.h to fix build failureChengwei Yang2013-06-261-0/+1
| | | | | | | | | In Linux envrionment, signal.h included by sys/wait.h, however, this isn't the case in FreeBSD. So explicit include it to fix build failure. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66197 Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-send: Fix fail to run without "--dest" optionChengwei Yang2013-06-201-1/+1
| | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65923 Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Fix Werror=unused-function if build without X11Simon McVittie2013-06-131-1/+2
| | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65712 Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-send: check usage a bit strictlyChengwei Yang2013-06-061-10/+34
| | | | | | | | | | | | | | | | | This commit does several more strictly check for dbus-send as its usage suggested. * now --address is an invalid option but --address=, this just like the others, say --reply-timeout=, --dest=, --type= * --print-reply= only take an optional argument "=literal" * --print-reply= will cause error with missing MSEC and invalid MSEC will cause invalid value error * --dest= will cause error with missing a NAME and also call dbus_validate_bus_name to verify the NAME Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65424 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* massively simplify run-with-tmp-session-bus.sh by using dbus-run-sessionSimon McVittie2013-06-051-33/+12
| | | | | | | | | | | It turns out that if you don't second-guess the system by catching SIGINT, the right things happen: it's received by every program in the foreground process group, including dbus-run-session and dbus-daemon. Neither of those catch SIGINT (unlike dbus-launch) so they'll exit gracefully without the wrapper script needing to do anything special. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39196 Reviewed-by: Colin Walters <walters@verbum.org>
* Add dbus-run-sessionSimon McVittie2013-06-052-0/+481
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39196 Reviewed-by: Colin Walters <walters@verbum.org>
* Fix compiler warnings when X11 autolaunch and launchd are both disabledSimon McVittie2013-05-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64362 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Thiago Macieira <thiago@kde.org>
* Include config.h as the first thing in every .c fileSimon McVittie2013-02-222-0/+2
| | | | | | | | | ...except for CheckForAbstractSockets.c, which runs before config.h is generated, and sd-daemon.c, which is externally-maintained. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59971 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Colin Walters <walters@verbum.org>
* Don't leak temporary fds pointing to /dev/nullMichel HERMIER2012-11-091-0/+1
| | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=56927 [commit message added -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Fix launching of dbus-daemon on Windows in paths containing spacesWolfgang Baron2012-07-181-3/+4
| | | | | | | | | | | If dbus is installed in a path, which contains a space, dbus-launch will not launch the daemon. That is so, because a command line is built from just the path to the daemon and a parameter. The path has to be surrounded with quotes. This can be done unconditionally, because the quotes do not cause any trouble even if they are not needed. Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49450
* Revert "dbus-launch: add --exit-with-x11 option"Simon McVittie2012-06-271-27/+6
| | | | This reverts commit fcc656d430f53ad62c25e41d7e7bd880cbb726a0.
* Create /var/lib/dbus explicitly rather than as a side-effectSimon McVittie2012-06-251-3/+6
| | | | | | | | | Since Automake 1.11.4, an empty localstatelib_DATA variable will not create $(localstatelibdir) as a side-effect. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=51406 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
* When not producing a dynamic library, define DBUS_STATIC_BUILDSimon McVittie2012-06-151-0/+1
| | | | | | | | | | | | When targeting Windows, linking against the static library requires special effort to turn off DLL import/export processing. We normally link some things against the dynamic library, but if we're not building that, we'll have to link everything statically. Based on patches from 'william' on fd.o #46367. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33973 Tested-by: René Berber <Rene.Berber gmail com>
* dbus-launch: add --exit-with-x11 optionSimon McVittie2012-06-151-6/+27
| | | | | | | | | This is more suitable for distributions' Xsession scripts: it verifies that X is already available, and so never results in an attempt to poll stdin. Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39197
* dbus-launch: if using X to define the session lifetime, do not poll stdinSimon McVittie2012-06-151-4/+13
| | | | | | | | | | | | | | | | | | | | | | dbus-launch --exit-with-session attempts to scope the session length to various things: - if DISPLAY points to an X server, exit when the X session ends - if stdin is a terminal, exit when end-of-file is reached - if both are true, exit when one of them happens, whichever is first - if neither is true, fail These are not particularly useful semantics: if the session is scoped to the X session, then the terminal from which dbus-launch was launched is irrelevant. This also causes practical problems when dbus-launch consumes characters from the terminal from which it happens to have been launched (some display managers, like slim and nodm, run users' X sessions with stdin pointing to the terminal from which the init daemon happens to have started the display manager during boot, usually tty1 on Linux). Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39197