summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * manual-dir-iter: Apply a permissive licenseSimon McVittie2022-10-121-0/+4
| | | | | | | | | | | | | | This was contributed by Ralf Habacker, with a trivial change from Philip Withnall which I don't think affects its copyright. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * test-shutdown: Apply a permissive licenseSimon McVittie2022-10-121-0/+6
| | | | | | | | | | | | | | | | | | All significant contributions to this file were from companies or individuals that gave permission for relicensing to MIT (I have assumed that trivial changes from Marcus Brinkmann and Kjartan Maraas were too small to affect copyright status). Signed-off-by: Simon McVittie <smcv@collabora.com>
| * test-ids: Apply a permissive licenseSimon McVittie2022-10-121-0/+5
| | | | | | | | | | | | | | | | | | All significant contributions to this file were from companies that gave permission for relicensing to MIT (I have assumed that trivial changes from Marcus Brinkmann and Ralf Habacker were too small to affect copyright status). Signed-off-by: Simon McVittie <smcv@collabora.com>
| * test-autolaunch: Add a permissive licenseSimon McVittie2022-10-121-0/+6
| | | | | | | | | | | | | | | | The license for this file was never stated, but all contributions to it have been from Red Hat or Collabora, and representatives of both companies gave permission for MIT relicensing in 2007. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * launch-helper-for-tests: Add a permissive licenseSimon McVittie2022-10-121-1/+5
|/ | | | | | I wrote this, and it hasn't changed since. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'test-autolaunch-win-fixes' into 'master'Simon McVittie2022-10-121-1/+1
|\ | | | | | | | | | | | | test-autolaunch-win.c: Prevent assertion in dbus_message_unref() Closes #422 See merge request dbus/dbus!366
| * test-autolaunch-win.c: Prevent assertion in dbus_message_unref()Ralf Habacker2022-10-121-1/+1
|/ | | | | | | | | dbus_message_unref() is in principle able to handle a NULL parameter, but causes the program to abort when `fatal_warnings_on_check_failed` is set. Therefore the call with a NULL parameter is avoided from now on. Fixes #422
* Merge branch 'no-as-ac-expand' into 'master'Ralf Habacker2022-10-122-58/+17
|\ | | | | | | | | Autotools: use AX_RECURSIVE_EVAL instead of AS_AC_EXPAND See merge request dbus/dbus!364
| * Autotools: use AX_RECURSIVE_EVAL instead of AS_AC_EXPANDSimon McVittie2022-10-122-58/+17
|/ | | | | | | | | AX_RECURSIVE_EVAL is maintained as part of autoconf-archive, so we don't need to bundle our own copy and keep track of its licensing status. It's very similar to AS_AC_EXPAND, but the arguments are the other way round and it doesn't automatically AC_SUBST its result. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'no-pkg-m4' into 'master'Ralf Habacker2022-10-122-155/+1
|\ | | | | | | | | m4: Stop shipping our own copy of pkg.m4 See merge request dbus/dbus!365
| * m4: Stop shipping our own copy of pkg.m4Simon McVittie2022-10-122-155/+1
|/ | | | | | | | | | The canonical way to find these macro is to run autogen.sh or autoreconf while pkg-config (or pkgconf) is installed, which will copy an up-to-date version of the macros from /usr/share/aclocal. The `make dist` archive will include a bundled copy of those macros, but the git repository doesn't need them. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'autolaunch-win' into 'master'Ralf Habacker2022-10-111-22/+2
|\ | | | | | | | | Fixes for test-autolaunch-win See merge request dbus/dbus!363
| * test-autolaunch-win: Remove redundant check for ERROR messageSimon McVittie2022-10-111-21/+2
| | | | | | | | | | | | | | | | | | | | | | This seems to have been intended to give a more specific error message if the method call failed, but it will not have been effective, because dbus_connection_send_with_reply_and_block() ends with a check for ERROR messages using dbus_set_error_from_message(). This means that if the reply was an ERROR message, it will already have been converted into a DBusError by the time call_method() regains control. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * test-autolaunch-win: Don't overwrite an error with another errorSimon McVittie2022-10-111-1/+0
|/ | | | | | | | | | | | | | | | | | | An unrelated branch failed CI with this assertion failure: 26: dbus[6768]: error: arguments to dbus_set_error() were incorrect, assertion "(error) == NULL || !dbus_error_is_set ((error))" failed in file ...\dbus-errors.c line 365. Looking at the test, this seems to be the most likely candidate for this bug in error handling, which is masking whatever the real cause for the failure was (we can't tell from here). If dbus_connection_send_with_reply_and_block() returns NULL, then it should already have set the error. Fixing this bug in the error handling will hopefully give us a better error message for the actual failure if it happens again. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'autoconf-runstatedir' into 'master'Simon McVittie2022-10-119-27/+170
|\ | | | | | | | | | | | | Use ${runstatedir} for system bus instead of ${localstatedir}/run Closes #180 See merge request dbus/dbus!209
| * Add NEWS entries for #180Simon McVittie2022-10-111-0/+25
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
| * spec: Mention that the system bus address might actually be in /runSimon McVittie2022-10-111-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The interoperable address is unix:path=/var/run/dbus/system_bus_socket. However, in most (perhaps all) current Linux distributions, /var/run is guaranteed to be a symbolic link to /run, and using the path in /run has some advantages (particularly if automounters are used). Implementations that intend to be interoperable are not required to listen on exactly /var/run/dbus/system_bus_socket, as long as clients that connect to that socket will work correctly. Similarly, clients are not required to connect to exactly /var/run/dbus/system_bus_socket, as long as the overall system (consisting of the client and the OSs that it supports) ensures that it ends up connecting to the same well-known system bus that is available at /var/run/dbus/system_bus_socket. Because of the Unix conventions for how software installs into a prefix, building a D-Bus implementation with its default build-time configuration options will not necessarily result in an interoperable system bus. The system bus is normally shipped by OS distributors, who should ensure that they have configured it in a way that is interoperable. Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/180 Signed-off-by: Simon McVittie <smcv@collabora.com>
| * build: Put system bus socket in runstatedir by defaultIssam E. Maghni2022-10-115-17/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets OS distributors configure --runstatedir=/run if they want to, although for interoperability, they should only do this if they can guarantee that their /run and /var/run are equivalent. A previous commit adds a warning if we are using the default path on a system where /run and /var/run are not synoymous, mitigating the compatibility impact of this change. For CMake, this requires version 3.9, released in 2017. For Meson, this is currently controlled by the runtime_dir option, which defaults to /run if the prefix is /usr. The rationale for this is that /run is correct for modern Unix systems, and distributors who switch from Autotools or CMake to Meson need to review all their build options at that time, which is an ideal opportunity to check that they are doing the right thing around /run. Helps: https://gitlab.freedesktop.org/dbus/dbus/-/issues/180 Co-authored-by: Simon McVittie <smcv@collabora.com>
| * build: Show a warning if the system bus socket is not interoperableSimon McVittie2022-10-115-0/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We would like to start using ${runstatedir}/dbus/system_bus_socket, so that distributors who make /var/run a symbolic link to /run will usually get their dbus-daemon listening on /run/dbus/system_bus_socket, which has some advantages in corner cases, such as when /var is mediated by an automounter or is unmounted during system shutdown. Unfortunately, the interoperable path in the D-Bus Specification is /var/run/dbus/system_bus_socket for historical reasons (D-Bus is older than /run), and older versions of Slackware are known to have had /run and /var/run as distinct directories. Do a check during configuration to catch systems configured like this and show a warning. When cross-compiling, this assumes that the system where dbus is built (the build system in Autotools/Meson, or the "host" in CMake terminology) has its /var/run and /run set up in a way that is compatible with the system where dbus will run (the host system in Autotools/Meson, or the "target" in CMake terminology). This is not 100% correct, but seems good enough for a warning that will hopefully only trigger for misguided OS distributors. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * build: Update a comment with the release status of AutoconfSimon McVittie2022-10-111-2/+2
| | | | | | | | | | | | It took a while, but Autoconf 2.70 was eventually released. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * build: Use AS_IF for system bus socketSimon McVittie2022-10-111-4/+5
|/ | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Update NEWSSimon McVittie2022-10-111-0/+5
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'spdx-syntax' into 'master'Simon McVittie2022-10-112-2/+2
|\ | | | | | | | | dbus/dbus-macros-internal, test/test-platform-mutex.c: Use upper case for SPDX license operator See merge request dbus/dbus!360
| * dbus/dbus-macros-internal, test/test-platform-mutex.c: Use upper case for ↵Ralf Habacker2022-10-112-2/+2
|/ | | | | | | SPDX license operator https://spdx.github.io/spdx-spec/SPDX-license-expressions/ says that using upper-case operators is canonical.
* Merge branch 'issue420' into 'master'Simon McVittie2022-10-112-9/+3
|\ | | | | | | | | | | | | dbus-message: Report OOM as OOM, not InvalidArgs Closes #420 See merge request dbus/dbus!353
| * dbus-message: Report OOM as OOM, not InvalidArgsSimon McVittie2022-10-112-9/+3
|/ | | | | Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/420 Signed-off-by: Simon McVittie <smcv@collabora.com>
* Update NEWSSimon McVittie2022-10-111-1/+21
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'dispatch_peer_messages' into 'master'Simon McVittie2022-10-115-6/+135
|\ | | | | | | | | | | | | dbus-monitor: Don’t send messages after becoming a monitor Closes #301 See merge request dbus/dbus!272
| * dbus-connection: Test built-in filtersKai A. Hiller2022-10-111-0/+87
| |
| * dbus-monitor: Disable automatic message filteringKai A. Hiller2022-10-112-2/+2
| |
| * dbus-connection: Add builtin_filters_enabled flagKai A. Hiller2022-10-112-4/+46
|/
* Merge branch 'stack-underflow' into 'master'Simon McVittie2022-10-111-2/+2
|\ | | | | | | | | config-parser: no longer get past the last NULL passed to locate_attributes See merge request dbus/dbus!357
| * config-parser: no longer get past the last NULL passed to locate_attributesEvgeny Vereshchagin2022-10-101-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: bc86794f23fa53 Fixes: ``` ==302818==ERROR: AddressSanitizer: stack-buffer-underflow on address 0x7ffd6ac253c0 at pc 0x000000534d0b bp 0x7ffd6ac24e10 sp 0x7ffd6ac24e08 READ of size 8 at 0x7ffd6ac253c0 thread T0 #0 0x534d0a in locate_attributes /home/vagrant/dbus/build/../bus/config-parser.c:658:16 #1 0x52ea3f in start_busconfig_child /home/vagrant/dbus/build/../bus/config-parser.c:1080:12 #2 0x52cca4 in bus_config_parser_start_element /home/vagrant/dbus/build/../bus/config-parser.c:2039:14 #3 0x52b82b in expat_StartElementHandler /home/vagrant/dbus/build/../bus/config-loader-expat.c:107:8 #4 0x7f2179f2d2bd (/lib64/libexpat.so.1+0xd2bd) (BuildId: 0165eed77c910f6ef2227d21afa9c5c5ed5849c2) #5 0x7f2179f2aed3 (/lib64/libexpat.so.1+0xaed3) (BuildId: 0165eed77c910f6ef2227d21afa9c5c5ed5849c2) #6 0x7f2179f2c9ec (/lib64/libexpat.so.1+0xc9ec) (BuildId: 0165eed77c910f6ef2227d21afa9c5c5ed5849c2) #7 0x7f2179f30a8e in XML_ParseBuffer (/lib64/libexpat.so.1+0x10a8e) (BuildId: 0165eed77c910f6ef2227d21afa9c5c5ed5849c2) #8 0x52b040 in bus_config_load /home/vagrant/dbus/build/../bus/config-loader-expat.c:259:9 #9 0x523c8a in bus_context_new /home/vagrant/dbus/build/../bus/bus.c:828:12 #10 0x521056 in main /home/vagrant/dbus/build/../bus/main.c:716:13 #11 0x7f2179a2954f in __libc_start_call_main (/lib64/libc.so.6+0x2954f) (BuildId: 9c5863396a11aab52ae8918ae01a362cefa855fe) #12 0x7f2179a29608 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x29608) (BuildId: 9c5863396a11aab52ae8918ae01a362cefa855fe) #13 0x42a914 in _start (/home/vagrant/dbus/build/bus/dbus-daemon+0x42a914) (BuildId: df5369f85137975aff9bd398ae859706cc3c52ff) Address 0x7ffd6ac253c0 is located in stack of thread T0 at offset 0 in frame #0 0x52cfaf in start_busconfig_child /home/vagrant/dbus/build/../bus/config-parser.c:733 ``` Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
* Merge branch 'clarify-marshalling' into 'master'Simon McVittie2022-10-083-6/+31
|\ | | | | | | | | | | | | Clarify demarshalling code Closes #413 See merge request dbus/dbus!355
| * dbus-marshal-basic: Fix an incorrect commentSimon McVittie2022-10-071-2/+2
| | | | | | | | | | | | | | | | We have 16-bit types with 2-byte alignment, but this comment claimed we only have 1-, 4- or 8-byte alignment. The actual implementation is fine, and correctly reports 2-byte alignment for the 16-bit types. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * dbus-marshal-basic: Assert that we are in-bounds after skipping itemsSimon McVittie2022-10-071-0/+8
| | | | | | | | | | | | | | We recommend disabling assertions in production builds of dbus, so it is "cheap" to add them even in relatively fast-path locations. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * dbus-marshal-basic: Clarify what is going on when we skip an itemSimon McVittie2022-10-071-0/+10
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
| * dbus-marshal-validate: Add more comments indicating what is going onSimon McVittie2022-10-071-0/+7
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
| * dbus-marshal-recursive: Correct an incorrect commentSimon McVittie2022-10-071-4/+1
| | | | | | | | | | | | | | array_reader_check_finished() no longer returns a type, only a boolean, so this comment isn't accurate any more. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * dbus-marshal-validate: Add an extra assertionSimon McVittie2022-10-071-0/+3
|/ | | | | | | We already checked that claimed_len <= (end - p), therefore we can assume that claimed_len + p <= end. Make this a bit more obvious. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'meson-monotonic-macos' into 'master'Simon McVittie2022-10-061-1/+3
|\ | | | | | | | | | | | | Check for more symbols before defining HAVE_CLOCK_MONOTONIC in Meson Closes #419 See merge request dbus/dbus!352
| * Check for more symbols before defining HAVE_CLOCK_MONOTONIC in MesonJordan Williams2022-10-061-1/+3
|/ | | | | | | | | MacOS has limited support for monotonic clock in its pthread implementation. When building with Meson, `HAVE_MONOTONIC_CLOCK` is defined despite this. This PR checks for the existence of the missing function `pthread_condattr_setclock`. To match parity with AutoTools, it also checks for `clock_getres`. Fixes #419.
* Post-release version bumpSimon McVittie2022-10-053-2/+7
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Prepare v1.15.2dbus-1.15.2Simon McVittie2022-10-054-9/+30
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Update NEWSSimon McVittie2022-10-051-0/+24
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Parse a message with a byteswapped Unix fd indexSimon McVittie2022-10-055-0/+48
| | | | | Reproduces: https://gitlab.freedesktop.org/dbus/dbus/-/issues/417 Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Add infrastructure to parse valid raw message blobsSimon McVittie2022-10-057-0/+194
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* dbus-marshal-byteswap: Byte-swap Unix fd indexes if neededSimon McVittie2022-10-051-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a D-Bus message includes attached file descriptors, the body of the message contains unsigned 32-bit indexes pointing into an out-of-band array of file descriptors. Some D-Bus APIs like GLib's GDBus refer to these indexes as "handles" for the associated fds (not to be confused with a Windows HANDLE, which is a kernel object). The assertion message removed by this commit is arguably correct up to a point: fd-passing is only reasonable on a local machine, and no known operating system allows processes of differing endianness even on a multi-endian ARM or PowerPC CPU, so it makes little sense for the sender to specify a byte-order that differs from the byte-order of the recipient. However, this doesn't account for the fact that a malicious sender doesn't have to restrict itself to only doing things that make sense. On a system with untrusted local users, a message sender could crash the system dbus-daemon (a denial of service) by sending a message in the opposite endianness that contains handles to file descriptors. Before this commit, if assertions are enabled, attempting to byteswap a fd index would cleanly crash the message recipient with an assertion failure. If assertions are disabled, attempting to byteswap a fd index would silently do nothing without advancing the pointer p, causing the message's type and the pointer into its contents to go out of sync, which can result in a subsequent crash (the crash demonstrated by fuzzing was a use-after-free, but other failure modes might be possible). In principle we could resolve this by rejecting wrong-endianness messages from a local sender, but it's actually simpler and less code to treat wrong-endianness messages as valid and byteswap them. Thanks: Evgeny Vereshchagin Fixes: ba7daa60 "unix-fd: add basic marshalling code for unix fds" Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/417 Resolves: CVE-2022-42012 Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Add targeted tests for dbus/dbus#413, dbus/dbus#418Simon McVittie2022-10-051-3/+95
| | | | | | | | | | Unlike the message-internals test, these do not rely on extra debug instrumentation in libdbus, and so can be used for "as-installed" testing. (However, they do require GLib.) Reproduces: https://gitlab.freedesktop.org/dbus/dbus/-/issues/413 Reproduces: https://gitlab.freedesktop.org/dbus/dbus/-/issues/418 Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Export G_TEST_BUILDDIR, G_TEST_SRCDIRSimon McVittie2022-10-053-0/+6
| | | | | | | | | | | | | | These environment variables are used by GLib's g_test_build_filename() and related convenience functions, which make it easier for unit tests to find data files in a way that works for both build-time tests and "as-installed" tests. During "as-installed" testing, both variables will normally be unset, and GLib uses the directory containing the executable. In most cases that results in the right thing happening, and this will also be true for dbus, since we install the test executables in ${libexecdir}/installed-tests, helper executables in the same place, and test data in ${libexecdir}/installed-tests/data. Signed-off-by: Simon McVittie <smcv@collabora.com>