Commit graph

3411 commits

Author SHA1 Message Date
Simon Peeters
d728fdc655 Set correct address when using --address=systemd:
When dbus gets launched through systemd, we need to create an address
string based on the sockets passed.

The _dbus_append_addres_from_socket() function is responsible for
extracting the address information from the file-descriptor and
formatting it in a dbus friendly way.

This fixes bus activation when running dbus under a systemd session.

https://bugs.freedesktop.org/show_bug.cgi?id=50962

Signed-off-by: Simon Peeters <peeters.simon@gmail.com>
2012-10-08 16:58:10 -04:00
Simon McVittie
778e2a5a91 Merge remote-tracking branch 'origin/master' 2012-10-04 08:55:49 +01:00
Simon McVittie
9fafead23d Merge branch 'dbus-1.6'
Conflicts:
	NEWS
	bus/activation-helper.c
	configure.ac
2012-10-04 08:54:58 +01:00
Simon McVittie
62aec8838a activation helper: when compiled for tests, do not reset system bus address
Otherwise, the tests try to connect to the real system bus, which will
often fail - particularly if you run the tests configured for the default
/usr/local (with no intention of installing the result), in which case
the tests would try to connect to /usr/local/var/run/dbus/system_bus_socket.

Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=52202
2012-10-04 08:17:27 +01:00
Colin Walters
e296f5c824 build: Make --disable-xml-docs build work again
We can't build the .html files without xmlto, so don't add them
to a dist_ variable.

https://bugs.freedesktop.org/show_bug.cgi?id=55426
2012-10-02 08:41:44 -04:00
Simon McVittie
40cc5ebd4a Post-release version bump 2012-10-02 09:47:20 +01:00
Colin Walters
c7495461fe Revert "hardening: Use __secure_getenv() in *addition* to _dbus_check_setuid()"
Follow to reverting a556443757b19fee67ef4441141246dd9cfed4f.
See https://bugs.freedesktop.org/show_bug.cgi?id=52202#c24

This reverts commit d7ffad7214.
2012-09-28 16:16:34 -04:00
Colin Walters
19fa7c547f Revert "hardening: Use __secure_getenv if available"
It breaks gnome-keyring-daemon at least in some
configurations; see
https://bugs.freedesktop.org/show_bug.cgi?id=52202#c24

This reverts commit 1a55644375.
2012-09-28 16:16:33 -04:00
Colin Walters
1cad15cc27 Release 1.6.8 2012-09-28 15:44:59 -04:00
Colin Walters
fb8b8ce72c Revert "hardening: Use __secure_getenv() in *addition* to _dbus_check_setuid()"
Follow to reverting a556443757b19fee67ef4441141246dd9cfed4f.
See https://bugs.freedesktop.org/show_bug.cgi?id=52202#c24

This reverts commit d7ffad7214.
2012-09-28 15:31:47 -04:00
Colin Walters
dcee0dd7c0 Revert "hardening: Use __secure_getenv if available"
It breaks gnome-keyring-daemon at least in some
configurations; see
https://bugs.freedesktop.org/show_bug.cgi?id=52202#c24

This reverts commit 1a55644375.
2012-09-28 15:31:05 -04:00
Colin Walters
819eb8a9f5 Resume development 2012-09-28 13:20:14 -04:00
Colin Walters
cf13cd08c7 Release 1.6.6 2012-09-28 13:08:42 -04:00
Geoffrey Thomas
fc4547fe08 activation-helper: Ensure DBUS_STARTER_ADDRESS is set correctly
The fix for CVE-2012-3524 filters out all environment variables if
libdbus is used from a setuid program, to prevent various spoofing
attacks.

Unfortunately, the activation helper is a setuid program linking
libdbus, and this creates a regression for launched programs using
DBUS_STARTER_ADDRESS, since it will no longer exist.

Fix this by hardcoding the starter address to the default system bus
address.

Signed-off-by: Geoffrey Thomas <gthomas@mokafive.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2012-09-28 12:55:38 -04:00
Colin Walters
9a0c289be6 hardening: Remove activation helper handling for DBUS_VERBOSE
It's not really useful.

See https://bugs.freedesktop.org/show_bug.cgi?id=52202#c17
2012-09-28 12:55:38 -04:00
Colin Walters
d7ffad7214 hardening: Use __secure_getenv() in *addition* to _dbus_check_setuid()
This is a further security measure for the case of Linux/glibc
when we're linked into a binary that's using filesystem capabilities
or SELinux domain transitions (i.e. not plain old setuid).

In this case, _dbus_getenv () will return NULL because it will
use __secure_getenv(), which handles those via AT_SECURE.

https://bugs.freedesktop.org/show_bug.cgi?id=52202
2012-09-28 12:55:38 -04:00
Colin Walters
c27c500413 hardening: Ensure _dbus_check_setuid() is initialized threadsafe manner
This is a highly theoretical concern, but we might as well.

https://bugs.freedesktop.org/show_bug.cgi?id=52202
2012-09-28 12:55:38 -04:00
Colin Walters
1a55644375 hardening: Use __secure_getenv if available
This helps us in the case where we were executed via filesystem
capabilities or a SELinux domain transition, not necessarily a plain
old setuid binary.

https://bugs.freedesktop.org/show_bug.cgi?id=52202
2012-09-28 12:55:38 -04:00
Colin Walters
a52319bc29 CVE-2012-3524: Don't access environment variables or run dbus-launch when setuid
This matches a corresponding change in GLib.  See
glib/gutils.c:g_check_setuid().

Some programs attempt to use libdbus when setuid; notably the X.org
server is shipped in such a configuration. libdbus never had an
explicit policy about its use in setuid programs.

I'm not sure whether we should advertise such support.  However, given
that there are real-world programs that do this currently, we can make
them safer with not too much effort.

Better to fix a problem caused by an interaction between two
components in *both* places if possible.

How to determine whether or not we're running in a privilege-escalated
path is operating system specific.  Note that GTK+'s code to check
euid versus uid worked historically on Unix, more modern systems have
filesystem capabilities and SELinux domain transitions, neither of
which are captured by the uid comparison.

On Linux/glibc, the way this works is that the kernel sets an
AT_SECURE flag in the ELF auxiliary vector, and glibc looks for it on
startup.  If found, then glibc sets a public-but-undocumented
__libc_enable_secure variable which we can use.  Unfortunately, while
it *previously* worked to check this variable, a combination of newer
binutils and RPM break it:
http://www.openwall.com/lists/owl-dev/2012/08/14/1

So for now on Linux/glibc, we fall back to the historical Unix version
until we get glibc fixed.

On some BSD variants, there is a issetugid() function.  On other Unix
variants, we fall back to what GTK+ has been doing.

Reported-by: Sebastian Krahmer <krahmer@suse.de>
Signed-off-by: Colin Walters <walters@verbum.org>
2012-09-28 12:55:38 -04:00
Geoffrey Thomas
f68dbdc3e6 activation-helper: Ensure DBUS_STARTER_ADDRESS is set correctly
The fix for CVE-2012-3524 filters out all environment variables if
libdbus is used from a setuid program, to prevent various spoofing
attacks.

Unfortunately, the activation helper is a setuid program linking
libdbus, and this creates a regression for launched programs using
DBUS_STARTER_ADDRESS, since it will no longer exist.

Fix this by hardcoding the starter address to the default system bus
address.

Signed-off-by: Geoffrey Thomas <gthomas@mokafive.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2012-09-28 12:08:28 -04:00
Colin Walters
57ae367050 hardening: Remove activation helper handling for DBUS_VERBOSE
It's not really useful.

See https://bugs.freedesktop.org/show_bug.cgi?id=52202#c17
2012-09-28 12:01:56 -04:00
Colin Walters
d4379ee8db hardening: Use __secure_getenv() in *addition* to _dbus_check_setuid()
This is a further security measure for the case of Linux/glibc
when we're linked into a binary that's using filesystem capabilities
or SELinux domain transitions (i.e. not plain old setuid).

In this case, _dbus_getenv () will return NULL because it will
use __secure_getenv(), which handles those via AT_SECURE.

https://bugs.freedesktop.org/show_bug.cgi?id=52202
2012-09-28 10:18:15 -04:00
Colin Walters
4b351918b9 hardening: Ensure _dbus_check_setuid() is initialized threadsafe manner
This is a highly theoretical concern, but we might as well.

https://bugs.freedesktop.org/show_bug.cgi?id=52202
2012-09-28 10:18:15 -04:00
Colin Walters
d839f027ed hardening: Use __secure_getenv if available
This helps us in the case where we were executed via filesystem
capabilities or a SELinux domain transition, not necessarily a plain
old setuid binary.

https://bugs.freedesktop.org/show_bug.cgi?id=52202
2012-09-28 10:18:15 -04:00
Colin Walters
23fe78ceef CVE-2012-3524: Don't access environment variables or run dbus-launch when setuid
This matches a corresponding change in GLib.  See
glib/gutils.c:g_check_setuid().

Some programs attempt to use libdbus when setuid; notably the X.org
server is shipped in such a configuration. libdbus never had an
explicit policy about its use in setuid programs.

I'm not sure whether we should advertise such support.  However, given
that there are real-world programs that do this currently, we can make
them safer with not too much effort.

Better to fix a problem caused by an interaction between two
components in *both* places if possible.

How to determine whether or not we're running in a privilege-escalated
path is operating system specific.  Note that GTK+'s code to check
euid versus uid worked historically on Unix, more modern systems have
filesystem capabilities and SELinux domain transitions, neither of
which are captured by the uid comparison.

On Linux/glibc, the way this works is that the kernel sets an
AT_SECURE flag in the ELF auxiliary vector, and glibc looks for it on
startup.  If found, then glibc sets a public-but-undocumented
__libc_enable_secure variable which we can use.  Unfortunately, while
it *previously* worked to check this variable, a combination of newer
binutils and RPM break it:
http://www.openwall.com/lists/owl-dev/2012/08/14/1

So for now on Linux/glibc, we fall back to the historical Unix version
until we get glibc fixed.

On some BSD variants, there is a issetugid() function.  On other Unix
variants, we fall back to what GTK+ has been doing.

Reported-by: Sebastian Krahmer <krahmer@suse.de>
Signed-off-by: Colin Walters <walters@verbum.org>
2012-09-27 21:10:28 -04:00
Simon McVittie
4d0a69027e Merge branch 'dbus-1.6' 2012-09-03 10:20:01 +01:00
Simon McVittie
6dcef0c8f0 NEWS 2012-09-03 10:19:29 +01:00
Brad Smith
712f148205 Detect MSG_NOSIGNAL and SCM_RIGHTS on OpenBSD
On OpenBSD, sys/socket.h requires sys/types.h to be included first.

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54418
2012-09-03 10:12:02 +01:00
Simon McVittie
8d012ff68d NEWS for #38201 2012-08-13 20:15:19 +01:00
Simon McVittie
d353e73d35 Merge branch 'dbus-1.6', rejecting reversion of #38201 2012-08-13 20:14:16 +01:00
Simon McVittie
dddedfa27d Revert "cmake: use the same default system bus address as for autotools"
This reverts commit 05b0b9e65b.
2012-08-13 20:13:16 +01:00
Simon McVittie
627cdde0eb Revert "Split DBUS_SESSION_BUS_DEFAULT_ADDRESS into listen, connect addresses and set better defaults"
This reverts commit b5d36dc27d.

On second thoughts, this is too big a change for a stable branch.
2012-08-13 20:12:59 +01:00
Simon McVittie
1dd0ff6d5b Merge branch 'dbus-1.6' 2012-08-13 20:02:11 +01:00
Simon McVittie
b5d36dc27d Split DBUS_SESSION_BUS_DEFAULT_ADDRESS into listen, connect addresses and set better defaults
On Unix, the connect address should basically always be "autolaunch:"
but the listen address has to be something you can listen on.

On Windows, you can listen on "autolaunch:" or
"autolaunch:scope=*install-path", for instance, and the dbus-daemon is
involved in the auto-launching process.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38201
Reviewed-by: David Zeuthen <davidz@redhat.com>
[default address changed to autolaunch: for interop with GDBus -smcv]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-08-13 19:57:13 +01:00
Simon McVittie
05b0b9e65b cmake: use the same default system bus address as for autotools
The system bus is unsupported (and rather meaningless) on Windows anyway,
so we can use anything. Also, make it clear that it has to be a
"specific" address that can be listened on *and* connected to,
like unix:path=/xxx - a listen-only address like unix:tmpdir=/xxx or
nonce-tcp: would not be suitable.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38201
Reviewed-by: David Zeuthen <davidz@redhat.com>
2012-08-13 19:51:42 +01:00
Simon McVittie
e33c318c13 NEWS 2012-08-09 12:42:52 +01:00
Simon McVittie
0786e46318 Merge branch 'master' of git+ssh://git.freedesktop.org/git/dbus/dbus 2012-08-09 12:37:25 +01:00
Simon McVittie
0e0111304e Merge branch 'dbus-1.6'
Conflicts:
	NEWS
	configure.ac
2012-08-09 12:32:32 +01:00
Simon McVittie
9436816175 NEWS 2012-08-09 12:31:48 +01:00
Jonathan Perkin
ed0e9e982e Define __EXTENSIONS__ on Solaris to get sockaddr_in6 and sockaddr_storage
[smcv: comments updated, commit message added]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53286
2012-08-09 12:26:06 +01:00
Jonathan Perkin
e98107548c Check HAVE_DECL_LOG_PERROR with #if, not #ifdef
It's always defined.

[smcv: commit message added]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53286
2012-08-09 12:25:02 +01:00
Simon McVittie
15e990d68d 1.6.5 2012-07-18 19:30:23 +01:00
Simon McVittie
93f78602b2 Prepare 1.6.4 release 2012-07-18 18:11:49 +01: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
Colin Walters
88f8d44aed spec: Mention object path and interface name
We didn't actually have /org/freedesktop/DBus in the spec, nor did we
explicitly mention the existence of "org.freedesktop.DBus" as an
interface, although it is implicit in the method names.

https://bugs.freedesktop.org/show_bug.cgi?id=51865
2012-07-18 10:19:20 -04:00
Simon McVittie
55024f65a6 Merge branch 'dbus-1.6' 2012-07-03 20:12:16 +01:00
Simon McVittie
a5d4c4aa35 NEWS 2012-07-03 20:12:10 +01:00
Simon McVittie
aef027e946 Merge branch 'dbus-1.6' 2012-07-03 19:21:00 +01:00
Simon McVittie
d8de80969c Set enable-developer default to 'no'
Misplaced [] and () led to enable_developer=no being part of the
option's documentation instead of actually being the default value.

Regression in 1.6.2, caused by #34671.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=51657
Bug-Debian: http://bugs.debian.org/680027
Reviewed-by: David Zeuthen <davidz@redhat.com>
2012-07-03 19:03:19 +01:00
Simon McVittie
e5a945507b DBusTransport: do not assert that autolaunch address is non-empty
dbus-launch can apparently return an empty address under certain
circumstances, and dbus_parse_address() in the next line will return
a nice DBusError for an empty address rather than aborting the process.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=51657
Bug-Debian: http://bugs.debian.org/680027
Reviewed-by: David Zeuthen <davidz@redhat.com>
2012-07-03 19:02:53 +01:00