summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* DBusMessage: add support for custom marshalingbaserock/genivi/dbus-1.9.16-1-g92a2d95Aleksandar Kanchev2015-05-184-44/+132
| | | | | | | Add functions to support querying and manipulating the message body and signature. This is useful for code generators, which can generate custom marshaling functions based on a given IDL. Those functions tend to be optimized and faster than the generic iterator based marshaling.
* more NEWS, also more release namedbus-1.9.16Simon McVittie2015-05-141-0/+25
|
* 1.9.16Simon McVittie2015-05-142-9/+11
|
* Merge branch 'dbus-1.8'Simon McVittie2015-05-141-3/+6
|\ | | | | | | | | Conflicts: NEWS
| * add a missing change, fix some bug numbersSimon McVittie2015-05-141-2/+5
| |
* | Merge branch 'dbus-1.8'Simon McVittie2015-05-142-13/+37
|\ \ | |/ | | | | | | | | | | Conflicts: NEWS cmake/CMakeLists.txt configure.ac
| * start towards 1.8.20Simon McVittie2015-05-142-1/+6
| |
| * 1.8.18dbus-1.8.18Simon McVittie2015-05-142-4/+27
| |
| * Security hardening: force EXTERNAL auth in session.conf on UnixSimon McVittie2015-05-123-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DBUS_COOKIE_SHA1 is dependent on unguessable strings, i.e. indirectly dependent on high-quality pseudo-random numbers whereas EXTERNAL authentication (credentials-passing) is mediated by the kernel and cannot be faked. On Windows, EXTERNAL authentication is not available, so we continue to use the hard-coded default (all authentication mechanisms are tried). Users of tcp: or nonce-tcp: on Unix will have to comment this out, but they would have had to use a special configuration anyway (to set the listening address), and the tcp: and nonce-tcp: transports are inherently insecure unless special steps are taken to have them restricted to a VPN or SSH tunnelling. Users of obscure Unix platforms (those that trigger the warning "Socket credentials not supported on this Unix OS" when compiling dbus-sysdeps-unix.c) might also have to comment this out, or preferably provide a tested patch to enable credentials-passing on that OS. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90414
| * reader_init: Initialize all fields of struct DBusTypeReader (CID 54754, ↵Ralf Habacker2015-05-081-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 54772, 54773). This patch is based on the fix for 'Field reader.array_len_offset is uninitialized' Reported by Coverity: CID 54754, 54772, 54773: Uninitialized scalar variable (UNINIT) [smcv: also re-order how the class is set when we recurse, so that the sub-reader's class doesn't end up NULL] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
* | Fail to generate random bytes instead of falling back to rand()Simon McVittie2015-05-1412-119/+146
| | | | | | | | | | | | | | | | | | | | This is more robust against broken setups where we run out of memory or cannot read /dev/urandom. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90414 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> [smcv: document @error] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | Make UUID generation failableSimon McVittie2015-05-1410-43/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, this would always succeed, but might use weak random numbers in rare failure cases. I don't think these UUIDs are security-sensitive, but if they're generated by a PRNG as weak as rand() (<= 32 bits of entropy), we certainly can't claim that they're universally unique. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90414 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> [smcv: document @error] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | _dbus_server_init_base: raise a DBusErrorSimon McVittie2015-05-144-14/+24
| | | | | | | | | | | | | | | | | | | | This can currently only fail from OOM, but I'm about to make it possible to fail from insufficient entropy. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90414 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> [smcv: document @error] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | _dbus_server_new_for_socket: raise a DBusErrorSimon McVittie2015-05-144-13/+17
| | | | | | | | | | | | | | | | | | | | This can currently only fail due to OOM, but I'm about to make it possible to fail for other reasons. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90414 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> [smcv: correct failure to set error in one case; document @error] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | Security hardening: force EXTERNAL auth in session.conf on UnixSimon McVittie2015-05-143-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DBUS_COOKIE_SHA1 is dependent on unguessable strings, i.e. indirectly dependent on high-quality pseudo-random numbers whereas EXTERNAL authentication (credentials-passing) is mediated by the kernel and cannot be faked. On Windows, EXTERNAL authentication is not available, so we continue to use the hard-coded default (all authentication mechanisms are tried). Users of tcp: or nonce-tcp: on Unix will have to comment this out, but they would have had to use a special configuration anyway (to set the listening address), and the tcp: and nonce-tcp: transports are inherently insecure unless special steps are taken to have them restricted to a VPN or SSH tunnelling. Users of obscure Unix platforms (those that trigger the warning "Socket credentials not supported on this Unix OS" when compiling dbus-sysdeps-unix.c) might also have to comment this out, or preferably provide a tested patch to enable credentials-passing on that OS. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90414 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | dbus_daemon_publish_session_bus_address: Fix -Wsign-compare issue.Ralf Habacker2015-05-141-1/+4
| | | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90089 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | NEWSSimon McVittie2015-05-131-0/+11
| |
* | Avoid reading beyond the length of a variableSimon McVittie2015-05-131-1/+5
| | | | | | | | | | | | | | | | Appending &some as DBUS_TYPE_INT64, DBUS_TYPE_UINT64 or DBUS_TYPE_DOUBLE, where "some" is an int, reads beyond the bounds of that variable. Use a zero-filled DBusBasicValue instead. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30350
* | Fix whitespace as per Havoc's review (in 2010)Simon McVittie2015-05-131-1/+2
| | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30350
* | Implement dbus_message_iter_get_element_countChristian Dywan2015-05-133-7/+101
| | | | | | | | | | | | | | According unit tests are added to _dbus_message_test. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30350 Reviewed-by: Havoc Pennington <hp@pobox.com>
* | DBusSocket: put the #ifdef case before the !defined caseSimon McVittie2015-05-121-19/+19
| | | | | | | | | | | | | | This avoids the confusing #ifndef...#else anti-pattern. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | Convert mostly DBUS_SOCKET_... and DBUS_POLLABLE_.. macros for more type safety.Ralf Habacker2015-05-1211-63/+99
| | | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | Turn DBusSocket into a type-safe struct, preventing inappropriate conversionSimon McVittie2015-05-1212-207/+212
| | | | | | | | | | | | | | Fix the remaining platform-specific code to look at the struct's appropriate platform-specific member. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444
* | Remove _dbus_socket_is_invalid, no longer usedSimon McVittie2015-05-123-14/+0
| | | | | | | | | | | | | | | | It didn't have many users anyway, and I've replaced them with the DBUS_SOCKET_IS_VALID macro. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | Convert miscellaneous socket APIs to DBusSocketSimon McVittie2015-05-129-51/+58
| | | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | generic socket transport code: work in terms of DBusSocketSimon McVittie2015-05-126-25/+32
| | | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | Split _dbus_set_fd_nonblocking vs. _dbus_set_socket_nonblockingSimon McVittie2015-05-125-9/+18
| | | | | | | | | | | | | | | | The former is Unix-specific, the latter is also portable to Windows. On Unix, they're really the same thing. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | main: reload_pipe is (despite its name) a socket pairSimon McVittie2015-05-121-3/+5
| | | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | DBusMainLoop, DBusSocketSet: work in terms of DBusPollableSimon McVittie2015-05-129-83/+153
| | | | | | | | | | | | | | | | | | This requires generic support for keying hash tables by DBusPollable: there are already implementations for int and uintptr_t keys, but not for "int or uintptr_t depending on platform", which is what DBusPollable now means. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444
* | Mostly remove the remnants of an older socket abstraction layerSimon McVittie2015-05-122-15/+2
| | | | | | | | | | | | | | | | | | | | | | This is only used on Windows, and wasn't even a particularly abstract abstraction. I've removed DBUS_SOCKET_IS_INVALID in favour of DBUS_SOCKET_IS_VALID because I prefer to avoid double-negatives. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | dbus-sysdeps: add more infrastructure around DBusSocketSimon McVittie2015-05-121-3/+58
| | | | | | | | | | | | | | | | This is all trivial right now, but will become significant when we change DBusSocket into a type-safe struct. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | bus_unix_fds_passing_test: the results of _dbus_socketpair are socketsSimon McVittie2015-05-121-5/+6
| | | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | Use typedef DBusSocket for sockets fd's to avoid conversion warnings.Ralf Habacker2015-05-1213-76/+98
| | | | | | | | | | | | | | | | | | [smcv: remove unneeded and invalid dbus-sysdeps.h from public header; make prototype of _dbus_socketpair() consistent; undo conversion of getaddrinfo result from int to SOCKET; don't call _dbus_return_val_if_fail() from internal function] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444
* | Merge branch 'dbus-1.8'Simon McVittie2015-05-081-5/+4
|\ \ | |/
| * Revert "reader_init: Initialize all fields of struct DBusTypeReader (CID ↵Simon McVittie2015-05-081-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 54754, 54772, 54773)." This reverts commit 21a7873f20145d561c2de8f084d98200a8de2c83. This appears to cause a segfault, presumably resulting from something assuming that reader_init() would not reinitialize all fields: #0 0x00007ffff7b74777 in _dbus_type_reader_get_current_type (reader=reader@entry=0x7fffffffda50) at .../dbus/dbus-marshal-recursive.c:791 #1 0x00007ffff7b719d0 in _dbus_header_cache_check (header=<optimized out>) at .../dbus/dbus-marshal-header.c:209 #2 0x00007ffff7b719d0 in _dbus_header_cache_check (header=header@entry=0x624658, field=field@entry=6) at .../dbus/dbus-marshal-header.c:250 #3 0x00007ffff7b72884 in _dbus_header_get_field_basic (header=header@entry=0x624658, field=field@entry=6, type=type@entry=115, value=value@entry=0x7fffffffdbd8) at .../dbus/dbus-marshal-header.c:1365 #4 0x00007ffff7b7d8c2 in dbus_message_get_destination (message=message@entry=0x624650) at .../dbus/dbus-message.c:3457 #5 0x00007ffff7b67be6 in _dbus_connection_send_preallocated_unlocked_no_update (connection=connection@entry=0x6236d0, preallocated=0x0, preallocated@entry=0x6234c0, message=message@entry=0x624650, client_serial=client_serial@entry=0x7fffffffdcbc) at .../dbus/dbus-connection.c:2017
* | auth_set_unix_credentials: Fix calling _dbus_credentials_add_pid without ↵Ralf Habacker2015-05-061-2/+4
| | | | | | | | | | | | | | | | | | checking return value (CID 54708). Reported by Coverity: CID 54708: Unchecked return value (CHECKED_RETURN) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | auth_set_unix_credentials: Fix calling _dbus_credentials_add_unix_uid ↵Ralf Habacker2015-05-061-1/+4
| | | | | | | | | | | | | | | | | | without checking return value (CID 54722). Reported by Coverity: CID 54722: Unchecked return value (CHECKED_RETURN) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | Merge remote-tracking branch 'origin/dbus-1.8'Ralf Habacker2015-05-063-6/+16
|\ \ | |/
| * reader_init: Initialize all fields of struct DBusTypeReader (CID 54754, ↵Ralf Habacker2015-05-061-4/+5
| | | | | | | | | | | | | | | | | | | | | | 54772, 54773). This patch is based on the fix for 'Field reader.array_len_offset is uninitialized' Reported by Coverity: CID 54754, 54772, 54773: Uninitialized scalar variable (UNINIT) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
| * do_check_nonce: Fix of calling _dbus_string_append_len without checking ↵Ralf Habacker2015-05-061-1/+7
| | | | | | | | | | | | | | | | | | return value (CID 54720). Reported by Coverity: CID: Unchecked return value (CHECKED_RETURN) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
| * dbus_message_demarshal: Fix calling _dbus_string_append_len without checking ↵Ralf Habacker2015-05-061-1/+4
| | | | | | | | | | | | | | | | | | return value (CID 54690). Reported by Coverity: CID 54690: Unchecked return value (CHECKED_RETURN) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | Update NEWS for 1.9 branchSimon McVittie2015-05-051-1/+5
| |
* | Merge branch 'dbus-1.8'Simon McVittie2015-05-053-8/+65
|\ \ | |/
| * NEWS for 1.8 branchSimon McVittie2015-05-051-1/+20
| |
| * DBusCounter: add a mutex to protect the refcount and notify functionAdrian Szyndela2015-05-051-5/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The overall problem here is that DBusCounter is indirectly linked to a DBusConnection, but is not actually guaranteed to be protected by that connection's mutex; and a DBusMessage can carry a reference to the DBusCounter, resulting in freeing that DBusMessage having an effect on the DBusCounter. Making the refcount atomic would not be a sufficient fix, since it would not protect the notify function: _dbus_counter_notify() could be called indirectly by dbus_message_unref(), in an arbitrary thread that does not hold the DBusConnection's lock, at the same time that the holder of the DBusConnection lock calls _dbus_transport_set_max_message_size(). [smcv: added commit message] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89297 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
| * extend lock's range in live_messages_notify()Adrian Szyndela2015-05-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The other code paths that ref or unref a transport are protected by the DBusConnection's lock. This function already used that lock, but for a narrower scope than the refcount manipulation. live_messages_notify() could be triggered by unreffing messages that originated from the same connection in a different thread. [smcv: added commit message] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90312 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | tools: MSVC compile fixesRalf Habacker2015-05-012-2/+10
| | | | | | | | | | | | | | | | unistd.h and sleep() are normally Unix-specific, although mingw also provides them. The Windows C runtime documents _environ as its equivalent of Unix environ. https://bugs.freedesktop.org/show_bug.cgi?id=90089 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | Merge remote-tracking branch 'origin/dbus-1.8'Ralf Habacker2015-05-011-1/+4
|\ \ | |/ | | | | | | | | Conflicts: cmake/test/CMakeLists.txt test/Makefile.am
| * dbus_server_set_auth_mechanisms: Fix returning without unlocking ↵Ralf Habacker2015-04-281-1/+4
| | | | | | | | | | | | | | | | | | server->mutex->lock (CID 54749). Reported by Coverity: CID 54749: Missing unlock (LOCK) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
| * Add manual tcp test case.Ralf Habacker2015-04-153-0/+56
| | | | | | | | | | | | | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> (cherry picked from commit fa1ada44eabd62b46b89c7be22bfce6d595d8dac) Conflicts: cmake/test/CMakeLists.txt test/Makefile.am