Commit graph

3341 commits

Author SHA1 Message Date
Simon McVittie
589ca59b2f Stop release preparation, --exit-with-x11 doesn't work 2012-06-25 20:54:56 +01:00
Simon McVittie
453457904b Prepare 1.6.2 2012-06-25 15:27:05 +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
e29efffd88 dbus_pending_call_set_notify: don't leave the connection locked on OOM
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=51032
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Lennart Poettering <lennart@poettering.net>
2012-06-25 15:22:38 +01:00
Simon McVittie
a12e6f3ccf NEWS 2012-06-25 13:59:23 +01:00
Simon McVittie
f51a9648ff Enable Automake maintainer mode by default, but let distros disable it
See http://blogs.gnome.org/desrt/2011/09/08/am_maintainer_mode-is-not-cool/
for more information.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34671
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-06-25 11:55:26 +01:00
Simon McVittie
e1427a2d66 Set configure defaults from --enable-developer, not Automake maintainer mode
Automake maintainer mode isn't about whether you're a maintainer or not
(although its name would suggest that), it's about whether files that are
normally distributed in the tarball get regenerated. As such, it's
not really appropriate to use it to drive defaults for things like
assertions and extra test code.

The desired effect is that developers building from git normally get
tests and assertions, while distribution packagers don't.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34671
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Colin Walters <walters@verbum.org>
2012-06-25 11:55:22 +01:00
Simon McVittie
3624e65986 NEWS 2012-06-15 16:03:39 +01:00
Simon McVittie
b47f4c22ee On Unix, link libdbus to a platform-specific threading library
On Linux, this is libpthread; on other Unixes, in principle it might be
called libpthreads or libthreads or something.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=47237
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2012-06-15 14:42:19 +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
09d71f92c3 NEWS 2012-06-15 13:22:16 +01:00
Simon McVittie
e9762e1542 Document that dbus-launch is not dbus-run-session
Architectural assumptions inside dbus-launch mean that it is unsuitable
for use in contexts where a particular process's lifetime defines the
session, unless there is an out-of-band mechanism (like the X server)
which can signal the end of the session.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39197
2012-06-15 13:10:41 +01:00
Simon McVittie
ba433723f7 dbus-launch: revise recommendations and put them in an EXAMPLES section
The first thing we should talk about is how to get a D-Bus session in
your X session - that's the common case.

Secondarily, we can tell command-line addicts how to have a D-Bus session.
Do not recommend --exit-with-session here, since that polls (and reads
from) stdin, which is harmful to precisely those command-line users!
Until we have some better tool, the best we can do here is note that
the dbus-daemon is not automatically terminated.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39197
2012-06-15 13:10:30 +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
faf0c88dfa Start 1.6.2 development 2012-06-05 15:03:58 +01:00
Simon McVittie
8f7e9cdd60 Fix distcheck with newer Doxygen: remove *.js, too, during uninstall 2012-06-05 13:29:11 +01:00
Simon McVittie
7db205d25d Fix distcheck: remove potentially-read-only files from builddir
During distcheck, the srcdir is read-only. During "make all", cp may
preserve the read-only status of the file copied from the srcdir,
resulting in failure to overwrite it with an identical file during
"make check" (which depends on all-local).

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-06-05 13:27:23 +01:00
Simon McVittie
9a727711a5 Prepare version 1.6.0 (new stable branch) 2012-06-05 13:14:07 +01:00
Simon McVittie
6a2af7b9a9 _dbus_transport_new_for_tcp_socket: add missing commas to address
Ralf pointed out that the address doesn't round-trip correctly.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45896
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Tested-by: Ralf Habacker <ralf.habacker@freenet.de>
2012-06-05 12:18:30 +01:00
Simon McVittie
df80949d92 Remove duplicate nonce-tcp (service-side) transport on Windows
Turns out this was duplicated too. We can just use the
platform-independent version, which uses the same code.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45896
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Tested-by: Ralf Habacker <ralf.habacker@freenet.de>
2012-06-05 12:18:23 +01:00
Simon McVittie
ad7245627c Remove duplicate nonce-tcp (client side) transport on Windows
_dbus_transport_open_socket is called before
_dbus_transport_open_platform_specific, and now handles nonce-tcp, so
this version is no longer useful.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45896
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Tested-by: Ralf Habacker <ralf.habacker@freenet.de>
2012-06-05 12:17:58 +01:00
Simon McVittie
e48de6be84 Merge branch 'dbus-1.4'
Conflicts:
	NEWS
	dbus/dbus-internals.c
	dbus/dbus-mainloop.c
	dbus/dbus-sysdeps-unix.c
	dbus/dbus-sysdeps-win.c
	dbus/dbus-sysdeps.c
	dbus/dbus-sysdeps.h
2012-04-25 19:24:55 +01:00
Simon McVittie
b19e14330f NEWS 2012-04-25 19:12:15 +01:00
Antoine Jacoutot
069c96ccde use cp and mkdir -p instead of install within source tree
$(INSTALL) and $(INSTALL_DATA) try to change ownerships to root:bin when
copying tests to builddir. Presumably this is a difference in behaviour
between GNU and BSD install(1): the one in GNU coreutils doesn't try-and-fail
to change ownership if you're not root.

[Commit message added by smcv]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48127
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-04-25 19:12:03 +01:00
David Zeuthen
8703514397 Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication method
When libdbus-1 moved to using monotonic time support for the
DBUS_COOKIE_SHA1 authentication was broken, in particular
interoperability with non-libdbus-1 implementations such as GDBus.

The problem is that if monotonic clocks are available in the OS,
_dbus_get_current_time() will not return the number of seconds since
the Epoch so using it for DBUS_COOKIE_SHA1 will violate the D-Bus
specification. If both peers are using libdbus-1 it's not a problem
since both ends will use the wrong time and thus agree. However, if
the other end is another implementation and following the spec it will
not work.

First, we change _dbus_get_current_time() back so it always returns
time since the Epoch and we then rename it _dbus_get_real_time() to
make this clear. We then introduce _dbus_get_monotonic_time() and
carefully make all current users of _dbus_get_current_time() use it,
if applicable. During this audit, one of the callers,
_dbus_generate_uuid(), was currently using monotonic time but it was
decided to make it use real time instead.

Signed-off-by: David Zeuthen <davidz@redhat.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48580
2012-04-12 11:18:07 -04:00
David Zeuthen
8734e4a16f Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication method
When libdbus-1 moved to using monotonic time support for the
DBUS_COOKIE_SHA1 authentication was broken, in particular
interoperability with non-libdbus-1 implementations such as GDBus.

The problem is that if monotonic clocks are available in the OS,
_dbus_get_current_time() will not return the number of seconds since
the Epoch so using it for DBUS_COOKIE_SHA1 will violate the D-Bus
specification. If both peers are using libdbus-1 it's not a problem
since both ends will use the wrong time and thus agree. However, if
the other end is another implementation and following the spec it will
not work.

First, we change _dbus_get_current_time() back so it always returns
time since the Epoch and we then rename it _dbus_get_real_time() to
make this clear. We then introduce _dbus_get_monotonic_time() and
carefully make all current users of _dbus_get_current_time() use it,
if applicable. During this audit, one of the callers,
_dbus_generate_uuid(), was currently using monotonic time but it was
decided to make it use real time instead.

Signed-off-by: David Zeuthen <davidz@redhat.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48580
2012-04-12 10:53:50 -04:00
Simon McVittie
3ad045bb8b 1.5.13 2012-03-27 19:18:23 +01:00
Simon McVittie
b01214cd58 Prepare dbus 1.5.12 2012-03-27 17:25:25 +01:00
Simon McVittie
d891d816d7 Build _dbus_string_starts_with_c_str even if not building tests
It's used by the own_prefix implementation.
2012-03-27 17:19:44 +01:00
Simon McVittie
a183a33fb5 Merge remote-tracking branch 'alban/own_prefix2'
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46273
2012-03-27 15:05:56 +01:00
Simon McVittie
2460ddfdb2 Merge branch 'dbus-1.4'
Conflicts:
	NEWS
	configure.ac
2012-03-27 14:52:24 +01:00
Simon McVittie
6edbb08b0e Start 1.4.21 2012-03-27 14:25:49 +01:00
Simon McVittie
24e0d90908 Prepare version 1.4.20 2012-03-27 13:00:19 +01:00
Andoni Morales Alastruey
35bbc8b194 Fix duplicate case value compiling with mingw-w64
In mingw-w64 both ESOMETHING and WSASOMETHING are defined,
leading to a duplicate case in the switch.

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=47321
2012-03-27 12:17:53 +01:00
Martin Pitt
19343fb6a8 Port to glib 2.31.x g_thread API
g_thread_init() is deprecated since glib 2.24, call g_type_init() instead.
Bump glib requirement accordingly.

g_thread_create is deprecated since 2.31, use g_thread_new() instead. When
building with a glib earlier than 2.31, provide a backwards compatibility shim.

[Added a comment about why we're using g_type_init() in a test that
doesn't otherwise use GObject -smcv]

[Applied to 1.4 despite just being a deprecation fix because it also fixes
linking with GLib 2.32, in which gthread has been removed from gobject's
Requires and moved to Requires.private, Debian #665665 -smcv]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=44413
Bug-Debian: http://bugs.debian.org/665665
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-03-27 12:10:00 +01:00
Alban Crequy
f1cfc138ef test: enforce own_prefix policy rules
After parsing [allow|deny] rules with own_prefix, check they are enforced
correctly.

https://bugs.freedesktop.org/show_bug.cgi?id=46886
2012-03-22 11:51:23 +00:00
Alban Crequy
d0591d318f test: parse own_prefix policy rules
Just check that the parser accept [allow|deny] rules with own_prefix

https://bugs.freedesktop.org/show_bug.cgi?id=46886
2012-03-22 11:50:27 +00:00
Alban Crequy
14aed647a6 policy: remove unused parameter 2012-03-22 11:28:58 +00:00
Alban Crequy
97c11fe286 doc: update documentation with own_prefix policy rules
https://bugs.freedesktop.org/show_bug.cgi?id=46886
2012-03-22 11:28:58 +00:00
Lennart Poettering
f67f45979b transport: add new unixexec transport on Unix
The "unixexec:" transport will create a local AF_UNIX socket with
socketpair(), then fork and execute a binary on one side with STDIN and
STDOUT connected to it and then use the other side.

This is useful to implement D-Bus tunneling schemes, for example to get
a D-Bus connection to the system bus on a different host, similar how
udisks is already doing it. (udisks uses SSH TCP tunneling for this,
which is a bit ugly and less secure than this solution).

Suggested use is with connection strings like the following:

  unixexec:path=ssh,argv1=foobar,argv2=system-bus-bridge

or:

  unixexec:path=pkexec,argv1=system-bus-bridge

or even:

  unixexec:path=sudo,argv1=system-bus-bridge

The first line would execute the binary 'system-bus-bridge' on host
'foobar' and then pass D-Bus traffic to it. This (hypothetical) bridge
binary would then forward the information to the local system bus.

The second and third line use this scheme locally to acquire a
privileged connection through pkexec resp. sudo: instead of connecting
directly to the bus, they use the same bridge binary which will forward
all information to the system bus.

The arguments of the protocol are 'path' for the first execlp()
argument, and argv0, argv1, and so on for the following arguments. argv0
can be left out in which case path will be used.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35230
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-03-12 16:38:56 +00:00
Lennart Poettering
1a4d710d67 sysdeps-unix: introduce dbus_close_all() and make use of it where appropriate
This is optimized on Linux and enumerates through /proc/self/fd with a
fallback on brute-force closing of fds, in case /proc is not available.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35230
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-03-12 16:38:53 +00:00
Lennart Poettering
552ca4d0ce spec: document unixexec transports
This adds a specification text for the new unixexec: transport.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35230
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-03-12 16:38:36 +00:00
John Bradshaw
b328fee69b Fix spelling errors in dbus-launch(1)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=47076
Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=675491
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-03-12 13:53:05 +00:00
Simon McVittie
30361bac5d Merge branch 'dbus-1.4' 2012-03-12 11:55:27 +00:00
Simon McVittie
bee5d4fb05 Enumerate data files used in the build rather than using find(1)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33840
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2012-03-12 11:45:27 +00:00
Alban Crequy
3c7c255ee7 policy: enforce policy on "allow own_prefix"
https://bugs.freedesktop.org/show_bug.cgi?id=46886
2012-03-04 14:56:02 +00:00
Alban Crequy
5670dc6cf7 config parser: add own_prefix
https://bugs.freedesktop.org/show_bug.cgi?id=46882
2012-03-04 14:36:56 +00:00
Simon McVittie
915b71be44 Update NEWS 2012-02-28 12:51:26 +00:00