Commit graph

215 commits

Author SHA1 Message Date
Simon McVittie
4a0b41ee31 Include config.h as the first thing in every .c file
...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>
2013-02-22 13:08:27 +00:00
Michel HERMIER
9a9b0e2736 Don't leak temporary fds pointing to /dev/null
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=56927
[commit message added -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-11-09 16:02:01 +00:00
Wolfgang Baron
2a50cb475b Fix launching of dbus-daemon on Windows in paths containing spaces
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-07-18 18:10:07 +01:00
Simon McVittie
6ec9900bc1 Revert "dbus-launch: add --exit-with-x11 option"
This reverts commit fcc656d430.
2012-06-27 11:31:22 +01:00
Simon McVittie
e2b3b74512 Create /var/lib/dbus explicitly rather than as a side-effect
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-25 15:22:55 +01:00
Simon McVittie
efddba53da When not producing a dynamic library, define DBUS_STATIC_BUILD
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-15 14:25:48 +01:00
Simon McVittie
fcc656d430 dbus-launch: add --exit-with-x11 option
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-15 13:10:16 +01:00
Simon McVittie
1785b37e43 dbus-launch: if using X to define the session lifetime, do not poll stdin
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-15 13:09:58 +01:00
Simon McVittie
ab0cebd883 document how the various processes in dbus-launch interact
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39197
2012-06-15 13:09:14 +01:00
Simon McVittie
666344fc67 dbus-send.1, dbus-send: document --print-reply=literal consistently
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>
2012-02-14 16:15:59 +00:00
Simon McVittie
2ccbfb82dc dbus-monitor: remove unused SIGINT handler
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-08-05 12:26:29 +01:00
Simon McVittie
e3c12a86d6 Remove remnants of dbus-viewer
Parts of it were already missing, it wasn't compiled, and it depends on
dbus-glib and Gtk.
2011-07-29 11:49:20 +01:00
Simon McVittie
ee7244181e tools: use AM_CPPFLAGS, and wrap its lines 2011-07-29 11:49:18 +01:00
Simon McVittie
94a061d1b1 tools: simplify linking
* 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-29 11:07:51 +01:00
Simon McVittie
b643d18a36 tools: put bin_PROGRAMS one per line, eliminate unnecessary variable 2011-07-29 11:07:49 +01:00
Simon McVittie
c368b36901 Simplify linking by moving -export-dynamic to AM_LDFLAGS 2011-07-29 11:06:41 +01:00
Simon McVittie
b451102301 Remove DBUS_CLIENT_CFLAGS, which is always empty 2011-07-29 11:06:07 +01:00
Simon McVittie
0d7318ccc7 Merge branch 'dbus-1.4' 2011-07-28 11:32:46 +01:00
Simon McVittie
638828526a Fix spelling/grammatical mistakes detected by Debian's lintian(1)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38284
Reviewed-by: Lennart Poettering <lennart@poettering.net>
2011-07-28 11:05:43 +01:00
Cosimo Alfarano
f997b0ac48 Fix dbus-monitor using eavesdrop=true when no filters are passed
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-07-12 18:36:40 +01:00
Cosimo Alfarano
56b9629d69 Add "eavesdrop=true" as constant match rule for dbus-monitor
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37890
Bug-NB: NB#269748
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-07-11 17:03:54 +01:00
Simon McVittie
638a742a38 Use #!/bin/sh for run-with-tmp-session-bus.sh
It doesn't seem to have any bashisms, and bash isn't in /bin on *BSD.

Suggested by Timothy Redaelli.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35880
2011-06-01 18:36:23 +01:00
Simon McVittie
cea055514a Check for X even if X11 autolaunching is disabled
DBUS_ENABLE_X11_AUTOLAUNCH obviously requires DBUS_BUILD_X11. However,
the converse is not true.

If DBUS_BUILD_X11 is defined, dbus-launch will be able to connect to
the X server to determine when the session ends; most distributors will
want this, but it can be disabled with the standard Autoconf option
--without-x.

If DBUS_ENABLE_X11_AUTOLAUNCH is *also* defined, dbus-launch and libdbus
will be willing to perform autolaunch. Again, most distributors will want
this, but it can be disabled with --disable-x11-autolaunch.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19997
Reviewed-by: Colin Walters <walters@verbum.org>
2011-05-25 17:38:44 +01:00
Simon McVittie
c559ec0525 dbus-launch: pass_info: always free strings on OOM
This doesn't really do anything, because we're about to exit anyway, but
it placates static analysis tools.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29881
Bug-NB: NB#180486
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-05-25 16:13:19 +01:00
Simon McVittie
2ae391ccb3 dbus-send: remove minor dead code
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33128
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-05-25 16:11:27 +01:00
Will Thompson
435ddb0df1 minotaur: bail if asked to monitor >1 bus
A coworker was just tripped up by `dbus-monitor --session --system` only
monitoring the system bus. This patch would have saved him reproducing a
tricky bug several times!

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=26548
Reviewed-by: Colin Walters <walters@verbum.org>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-04-29 15:42:18 +01:00
Simon McVittie
75cecfc374 Break up the monster conditional in config-parser so gcov can cope
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=10887
Reviewed-by: Colin Walters <walters@verbum.org>
2011-04-07 11:25:54 +01:00
Simon McVittie
9a97f82079 Import compiler.m4 and lcov.am from telepathy-glib, and use them to replace gcov
Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=10887
2011-02-17 17:07:12 +00:00
Simon McVittie
a8302efd2c dbus-cleanup-sockets: free list of socket entries
Origin: vendor, Maemo
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33128
Bug-NB: NB#180486
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-01-17 12:18:40 +00:00
Christian Dywan
916620ea96 Free session file early in dbus-launch
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29881
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-01-05 14:55:42 +00:00
Christian Dywan
79b4e478d7 Check return value of XGetWindowProperty in x11_get_address
Reviewed-by: Thiago Macieira <thiago@kde.org>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29881
2011-01-05 14:42:45 +00:00
Mike McQuaid
2366423e97 Fix PROFILE_TIMED_FORMAT printf warning on OSX. 2010-12-04 01:42:41 +01:00
Will Thompson
75ef1d2ed4 Merge branch 'documentation-build-system' 2010-10-26 17:11:10 +01:00
Christian Dywan
b1f947da1a Free envvar and args in pass_info in the oom case 2010-10-05 13:47:07 +01:00
Will Thompson
46b9961be7 Move manpages to doc/
This will make integrating the building of HTML versions of these
manpages into the build system way easier, at the cost of keeping
manpages in a different directory to the source for the program they
describe. I think this is an acceptable trade-off.
2010-10-05 11:45:59 +01:00
Havoc Pennington
ade5c7ad33 fix some "unused result" warnings in dbus-launch and dbus-spawn
Needed to avoid -Werror
2010-09-06 19:30:42 +02:00
Ralf Habacker
cd815c347a Fixed compiler warnings. 2010-06-07 15:46:33 +02:00
Marcus Brinkmann
1af558a620 Fix _IOLBF for Windows CE and also define _IONBF if needed. 2010-05-12 14:59:45 +02:00
Ralf Habacker
892bb42550 Fixed assert raised with msvc 2008 on windows. 2010-05-10 22:57:48 +02:00
Ralf Habacker
da3578a1a7 Cleanup debug messages. 2010-05-03 11:56:40 +02:00
Marcus Brinkmann
f857bf034a Include strtoll.c and strtoull.c in distribution. 2010-04-14 08:23:29 +02:00
Marcus Brinkmann
5e4ef80e09 Add replacement functions strtoll/strtoull for dbus-send, mainly for Windows CE. 2010-04-13 21:08:10 +02:00
Marcus Brinkmann
f041773df2 Port dbus tools to Windows CE. 2010-04-13 20:58:20 +02:00
Colin Walters
df89cfeb38 Merge branch 'dbus-1.2'
Conflicts:
	bus/dispatch.c
	configure.in
	test/name-test/test-names.c
2010-03-22 14:39:56 -04:00
Colin Walters
3861cb42f4 [64 bit printf] Update to use DBUS_PID_FORMAT, print (omitted)
There were already defines for formatting pids and uids, so use those.

In the case where we don't have a format specifier for 64 bit, print
(omitted) in dbus-monitor.
2010-03-22 14:35:28 -04:00
Colin Walters
c93d3ec2ff Add DBUS_INT64_MODIFIER define, turn on -Wformat
https://bugs.freedesktop.org/show_bug.cgi?id=19195

We were previously using -Wno-format because we didn't have
a #define for DBUS_INT64_MODIFIER, which was really lame because
it easily hid problems.

For now, just define it if we're on glibc; this is obviously
not strictly correct but it's safe, because the formatting
is only used in DBUS_VERBOSE mode, and in tools/dbus-monitor.
Ideally we get the the glib code relicensed.
2010-03-22 13:58:56 -04:00
Marcus Brinkmann
dbecdeabb2 Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
Ralf Habacker
46df8b52d9 linux compile fix 2010-02-26 08:37:53 +01:00
Marcus Brinkmann
f31bb2a749 Enable dbus-launch for Windows target. 2010-02-11 22:38:55 +01:00
Romain Pokrzywka
1cd84d8258 remove DBUS_DAEMON_EXECUTABLE_NAME, we already have DBUS_DAEMON_NAME, and use the specified name for the executable when building with cmake 2010-02-07 00:32:46 +01:00