summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2015-02-11fix bug in parameter passing to dbus-daemon in dbus-launchSemun Lee1-4/+33
Change-Id: I7d097c15f8dfb72f832c08813e4931dc6c2555cb
2015-02-11[daemon-fix][dev] address to start kdbus bus changed to 'kdbus:', kdbus ↵Radoslaw Pajak1-0/+5
added to dbus-launch and autolaunch - address to start kdbus bus changed from 'kdbus' to 'kdbus:' - added kdbus bus creation option "--kdbus" to dbus-launch tool - added kdbus bus creation option to autolauch by adding scope=kdbus ("autolaunch:scope=kdbus" compiled as default when --enabel-kdbus-transport is given) - "Building kdbus support: yes/no" info added to configure Change-Id: I681d319733d067e7fc9d002ad370984ba469a342 Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
2014-06-11dbus-launch: kill bus if we can't attach to a session when requestedРоман Донченко1-1/+1
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=74698 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-04-30Avoid killing all available processes if an X error arrives early onРоман Донченко1-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
2014-03-06Update .gitignore filesLukasz Skalski1-0/+1
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75833 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-27Support printing unix file descriptors in dbus-send/dbus-monitorRobert Ancell1-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>
2013-10-09dbus-monitor: keep backwards compatibilityChengwei Yang1-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>
2013-10-09dbus-send: replace --address with --peer and --bus.Andrey Mazo1-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>
2013-10-09Revert "dbus-send: replace --address"... to fix attributionSimon McVittie1-31/+6
This reverts commit 5b74af796c8f1d9f3f60594f22c6bfd4c097ad8b.
2013-10-08Unify the way to find dbus-daemon test binaryChengwei Yang1-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>
2013-10-08dbus-send: replace --address with --peer and --bus.Simon McVittie1-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>
2013-10-08dbus-monitor: remove redundant match rulesChengwei Yang1-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>
2013-10-08When using dbus-launch for tests, fail hard if test binary is missingSimon McVittie1-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>
2013-10-08dbus-launch: avoid asprintf(), and die gracefully on out-of-memorySimon McVittie1-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>
2013-10-08Fix build on NetBSD 6.1.1 with gcc 4.5.3Chengwei Yang2-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>
2013-09-16Fix an incorrect sizeof.Sviatoslav Chagaev1-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>
2013-09-16Revert "Fix an incorrect sizeof." to fix attributionSimon McVittie1-1/+1
This reverts commit 3c1938180bdca8fc658907f6f692186be2b81b77.
2013-09-16Fix an incorrect sizeof.Simon McVittie1-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>
2013-09-13Use test binaries in build dir to do testChengwei Yang1-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
2013-09-05dbus-launch: unconditionally use SIGHUP and free memory on OOMChengwei Yang1-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>
2013-09-05run-with-tmp-session-bus.sh: create a unique temporary file per processSimon McVittie1-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>
2013-08-23dbus-run-session: remove various extra variables from the environmentSimon McVittie2-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>
2013-08-19Fixed compiler warning on windows.Ralf Habacker1-2/+2
https://bugs.freedesktop.org/show_bug.cgi?id=61874 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-06-28tests to embedded tests: replaced in toolsChengwei Yang1-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
2013-06-26dbus-launch: do not verbose output if build with verbose mode disabledChengwei Yang1-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
2013-06-26dbus-launch: align documentChengwei Yang1-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
2013-06-26dbus-launch: fix coding styleChengwei Yang1-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
2013-06-26FreeBSD: explicit include signal.h to fix build failureChengwei Yang1-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>
2013-06-20dbus-send: Fix fail to run without "--dest" optionChengwei Yang1-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>
2013-06-13Fix Werror=unused-function if build without X11Simon McVittie1-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>
2013-06-06dbus-send: check usage a bit strictlyChengwei Yang1-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>
2013-06-05massively simplify run-with-tmp-session-bus.sh by using dbus-run-sessionSimon McVittie1-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>
2013-06-05Add dbus-run-sessionSimon McVittie2-0/+481
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39196 Reviewed-by: Colin Walters <walters@verbum.org>
2013-05-10Fix compiler warnings when X11 autolaunch and launchd are both disabledSimon McVittie1-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>
2013-02-22Include config.h as the first thing in every .c fileSimon McVittie2-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>
2012-11-09Don't leak temporary fds pointing to /dev/nullMichel HERMIER1-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>
2012-07-18Fix launching of dbus-daemon on Windows in paths containing spacesWolfgang Baron1-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
2012-06-27Revert "dbus-launch: add --exit-with-x11 option"Simon McVittie1-27/+6
This reverts commit fcc656d430f53ad62c25e41d7e7bd880cbb726a0.
2012-06-25Create /var/lib/dbus explicitly rather than as a side-effectSimon McVittie1-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>
2012-06-15When not producing a dynamic library, define DBUS_STATIC_BUILDSimon McVittie1-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>
2012-06-15dbus-launch: add --exit-with-x11 optionSimon McVittie1-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
2012-06-15dbus-launch: if using X to define the session lifetime, do not poll stdinSimon McVittie1-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
2012-06-15document how the various processes in dbus-launch interactSimon McVittie1-0/+41
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39197
2012-02-14dbus-send.1, dbus-send: document --print-reply=literal consistentlySimon McVittie1-1/+1
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=14005 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
2011-08-05dbus-monitor: remove unused SIGINT handlerSimon McVittie1-8/+0
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-07-29Remove remnants of dbus-viewerSimon McVittie2-618/+0
Parts of it were already missing, it wasn't compiled, and it depends on dbus-glib and Gtk.
2011-07-29tools: use AM_CPPFLAGS, and wrap its linesSimon McVittie1-1/+7
2011-07-29tools: simplify linkingSimon McVittie1-4/+13
* dbus-send, dbus-uuidgen only need to link libdbus; libtool knows what extra libraries libdbus depends on * dbus-monitor uses a Winsock header (on Windows) so it needs NETWORK_libs,but still doesn't need threads * dbus-launch needs X (on Unix) but doesn't directly need threads or networking
2011-07-29tools: put bin_PROGRAMS one per line, eliminate unnecessary variableSimon McVittie1-4/+10
2011-07-29Simplify linking by moving -export-dynamic to AM_LDFLAGSSimon McVittie1-4/+3