Commit graph

3428 commits

Author SHA1 Message Date
Simon McVittie
cdff3bc41b path_namespace='/' should match everything
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=70799
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Reviewed-by: Ryan Lortie <desrt@desrt.ca>
2013-10-23 17:14:21 +01:00
Simon McVittie
a96207da08 1.6.17 2013-10-08 17:33:56 +01:00
Simon McVittie
2fefabaf64 1.6.14 2013-10-08 13:26:17 +01:00
Simon McVittie
3b85dfcf77 NEWS for 1.6.x 2013-09-16 14:58:24 +01:00
Vasiliy Balyasnyy
61889c8c11 dbus-sysdeps-unix.c: undeclared ret2 variable if HAVE_WRITEV undefined.
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69409
2013-09-16 13:58:31 +01:00
Sviatoslav Chagaev
01a0bba9f7 Fix a NULL dereference on an error code path.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69327
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-16 12:47:27 +01:00
Simon McVittie
1c95955cbc NEWS 2013-09-13 14:02:33 +01:00
Chengwei Yang
200a11ebbe Check EINVAL for accept4()
It was reported that accept4() will return -1 with errrno is EINVAL on
arm platform, so check EINVAL for accept4() and retry accept().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69026
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-13 13:40:08 +01:00
Pino Toscano
c1288c5366 Allow EPROTOTYPE for SOCK_CLOEXEC but unsupported by socket/socketpair
If SOCK_CLOEXEC is defined (usually because accept4 is implemented),
check for EPROTOTYPE (the POSIX errno for invalid socket types) in
addition to EINVAL as errno indicating whether socket and socketpair
do not support SOCK_CLOEXEC (and other SOCK_* flags).

[adapted by Chengwei Yang to give _dbus_connect_exec() the same treatment]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69073
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-13 13:36:32 +01:00
Chengwei Yang
7a53684d42 Check EINVAL for socketpair and retry without SOCK_CLOEXEC
As the same as _dbus_open_socket() and _dbus_full_duplex_pipe(),
socketpair() may fail with EINVAL if call with SOCK_CLOEXEC.

Check for the failure and retry without SOCK_CLOEXEC, in addition, only
call _dbus_fd_set_close_on_exec() if the socketpair failure happened.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69073
[trivial coding style fixes -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-13 13:33:21 +01:00
Chengwei Yang
37df7c316b Use the argument of dbus_connection_set_route_peer_messages()
The function dbus_connection_set_route_peer_messages() take a bool
argument, however, in the implementation, it always hard-code to TRUE
rather than take its bool argument.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69165
[amended commit message -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-13 12:35:00 +01:00
Sviatoslav Chagaev
a548141b17 Fix file descriptor leak in _dbus_command_for_pid
Fix a file descriptor not being closed when an error codepath is taken.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69182
Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
[more specific commit message -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-13 12:25:37 +01:00
Simon McVittie
0fbb337146 1.6.15 2013-09-05 17:26:18 +01:00
Simon McVittie
7b3f2143fd 1.6.14 2013-09-05 16:37:08 +01:00
Simon McVittie
fc600b6a8f _dbus_babysitter_unref: avoid infinite loop if waitpid() returns EINTR
If waitpid() failed with EINTR, we'd go back for another go, but
because ret is nonzero, we'd skip the waitpid() and just keep looping.

Also avoid an unnecessary "goto" in favour of a proper loop, to make it
more clearly correct.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68945
Reviewed-by: Colin Walters <walters@verbum.org>
2013-09-05 16:31:13 +01:00
Simon McVittie
ad5b3128ba NEWS for 1.6 2013-09-05 13:11:31 +01:00
Ivan Romanov
50b64a0c79 Use iface instead of interface in function parameters
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66493
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
(cherry picked from commit 0928169cf8)
2013-09-05 13:08:22 +01:00
Simon McVittie
42e12d342e run-with-tmp-session-bus.sh: create a unique temporary file per process
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>
(cherry picked from commit 9d80d46a79)
2013-09-05 13:05:21 +01:00
Simon McVittie
3b4a09c04e NEWS for 1.6 2013-09-05 13:03:06 +01:00
Colin Walters
b4ffcdc5eb test/marshal: Ensure we use suitably aligned buffers
This test was failing on s390; though it could fail
on other platforms too.  Basically we need to be sure
we're passing at least word-aligned buffers to the
demarshalling code.  malloc() will do that for us.

https://bugs.freedesktop.org/show_bug.cgi?id=67279
2013-07-25 09:16:16 -04:00
Simon McVittie
d9dc58efce NEWS for 1.6.x 2013-07-01 12:15:04 +01:00
Simon McVittie
00c1c0ac1f Make the test for #53499 more obviously correct 2013-07-01 12:14:02 +01:00
Chengwei Yang
cef5a419f4 Test: add a test case for escaping byte > 127
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53499
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-07-01 12:11:39 +01:00
Chengwei Yang
32e5cab56a Fix: a non ascii byte will trigger BadAddress error
If a byte in DBusString *unescaped isn't a ascii byte, which will be
cast to char (signed char on most of platform), so that's the issue
unsigned char cast to signed char. e.g. "\303\266" is a valid unicode
character, if everything goes right, it will be escaped to "%c3%b6".
However, in fact, it escaped to "%<garbage-byte>3%<garbage-byte>6".

_dbus_string_append_byte_as_hex() take an int parameter, so negative
byte is valid, but cause get a negative index in array. So garbage value
will get. e.g. '\303' --> hexdigits[((signed byte)(-61)) >> 4] is
hexdigits[-4].

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53499
Sgne-off-by: Chengwei Yang <chengwei.yang@intel.com>
[fixed whitespace -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-07-01 12:09:02 +01:00
Simon McVittie
160fbc9ec1 NEWS 2013-06-28 11:37:28 +01:00
Chengwei Yang
f023c0e265 Remove invoke of va_end before va_start
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=66300
2013-06-28 11:35:49 +01:00
Simon McVittie
931c9663b7 NEWS for #65959 2013-06-20 13:20:08 +01:00
Chengwei Yang
8eb29fda10 DBusString: fix may crash if try to free an uninitialized str
If the str will be freed hasn't been initialized by _dbus_string_init
correctly, _dbus_string_free may crash due to trying to free an
undefined memory.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65959
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-06-20 13:16:25 +01:00
Simon McVittie
ba0f90c16f Add release name for 1.6.12 2013-06-13 13:46:33 +01:00
Simon McVittie
22fd9df043 Start 1.6.13 2013-06-12 14:46:24 +01:00
Simon McVittie
159fdbf680 Prepare embargoed release for tomorrow 2013-06-12 14:02:31 +01:00
Simon McVittie
2420f7ae8b Add a test-case for CVE-2013-2168
Reviewed-by: Thiago Macieira <thiago@kde.org>
[build system adjusted to compile it even if we don't have GLib -smcv]
2013-06-12 13:56:39 +01:00
Simon McVittie
954d75b2b6 CVE-2013-2168: _dbus_printf_string_upper_bound: copy the va_list for each use
Using a va_list more than once is non-portable: it happens to work
under the ABI of (for instance) x86 Linux, but not x86-64 Linux.

This led to _dbus_printf_string_upper_bound() crashing if it should
have returned exactly 1024 bytes. Many system services can be induced
to process a caller-controlled string in ways that
end up using _dbus_printf_string_upper_bound(), so this is a denial of
service.

Reviewed-by: Thiago Macieira <thiago@kde.org>
2013-06-12 13:55:53 +01:00
Simon McVittie
355b470da7 NEWS for 1.6.x 2013-06-12 13:42:58 +01:00
Chengwei Yang
16f3b1246c Fix dbus-daemon crash due to invalid service file
dbus-daemon will crash due to invalid service file which key/value
starts before section. In that situation, new_line() will try to access
invalid address.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60853
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-06-12 13:42:00 +01:00
Chengwei Yang
634dc5d8a0 Fix build error: unused-result
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-06-05 17:27:54 +01:00
Chengwei Yang
b434238c34 When "activating" systemd, handle its special case better
When dbus-daemon receives a request to activate a systemd service before
systemd has connected to it, it enqueues a fake request to "activate"
systemd itself (as a way to get a BusPendingActivationEntry to track the
process of waiting for systemd). When systemd later joins the bus,
dbus-daemon sends the actual activation message; any future activation
messages are sent directly to systemd.

In the "pending" code path, the activation messages are currently
dispatched as though they had been sent by the same process that sent
the original activation request, which is wrong: the bus security
policy probably doesn't allow that process to talk to systemd directly.
They should be dispatched as though they had been sent by the
dbus-daemon itself (connection == NULL), the same as in the non-pending
code path.

In the worst case, if the attempt to activate systemd timed out, the
dbus-daemon would crash with a (fatal) warning, because in this special
case, activation_message is a signal with no serial number, whereas the
code to send an error reply is expecting a method call with a serial
number.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=50199
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Tested-by: Ma Yu <yu.ma@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-06-05 17:27:48 +01:00
Simon McVittie
1d560ff7f9 development version 2013-04-24 20:30:00 +01:00
Simon McVittie
a1883ddcac Prepare release 1.6.10 2013-04-24 12:14:57 +01:00
Simon McVittie
6d7782659a NEWS for 1.6 2013-04-22 16:15:34 +01:00
Simon McVittie
6b2add5e70 Accept non-characters when validating Unicode
Unicode Corrigendum #9 clarifies that the non-characters U+nFFFE
(for n in the range 0 to 0x10), U+nFFFF (for n in the same range),
and U+FDD0..U+FDEF are valid for interchange, and their presence
does not make a string ill-formed.

GLib 2.36 made the corresponding change in its definition of UTF-8
as used by g_utf8_validate() and similar functions.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63072
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-04-22 15:36:32 +01:00
Simon McVittie
540e5692e0 Allow use of GLib 2.32 functionality, which we do conditionally 2013-04-05 12:54:57 +01:00
Simon McVittie
c052230fff Don't warn for functions deprecated since GLib 2.26
Also warn if we inadvertently use a function introduced since then.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59971
Reviewed-by: Colin Walters <walters@verbum.org>
2013-04-05 12:48:23 +01:00
Simon McVittie
02be6d0553 NEWS for 1.6 2013-04-05 12:47:07 +01:00
Dan Williams
1495c207b4 Don't access random memory if data slot isn't allocated yet
If DBUS_DISABLE_ASSERTS was turned on, and a buggy program called
dbus_connection_get_data() with a slot number less than zero (eg,
before even allocating the data slot), random memory would be
accessed and a random value returned.  Anything less than zero
is not a valid slot number and should be rejected by libdbus.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63127
Signed-off-by: Dan Williams <dcbw@redhat.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-04-05 12:45:18 +01:00
Simon McVittie
aa8dcc13a6 NEWS for 1.6 2013-04-03 12:20:57 +01:00
Dagobert Michelsen
6485fafbca If alloca.h is available it is required (e.g. on Solaris 10)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63071
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-04-03 12:17:44 +01:00
Simon McVittie
74b4c3ac94 NEWS for 1.6 2013-02-12 11:44:11 +00:00
Ralf Habacker
91f2dd5388 Create missing directories in cmake <build-root>/bus/session.d and <build-root>/bus/system.d
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41319
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-01-15 09:34:43 +01:00
Simon McVittie
9b04b927ee NEWS 2012-11-09 16:02:53 +00:00