summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-11-17dbus 1.10.4dbus-1.10.4Simon McVittie2-3/+5
2015-11-17NEWSSimon McVittie1-1/+30
2015-11-17bus-driver: Support returning org.freedesktop.DBus UID and PIDJan Alexander Steffens (heftig)4-56/+127
Attempting to call SetEnvironment on systemd causes it to inquire about the caller's connection UID and PID. If this check fails, the call is rejected. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> [smcv: go back to DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN as the error code for failure to determine the pid]
2015-11-17test/sd-activation: Test UpdateActivationEnvironment forwardingJan Alexander Steffens (heftig)1-1/+211
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-17bus_driver_handle_update_activation_environment: Forward to systemdJan Alexander Steffens (heftig)1-3/+152
If we use systemd activation, forward all UpdateActivationEnvironment requests to org.freedesktop.systemd1.Manager.SetEnvironment, in order to ensure variables needed by D-Bus services are available when these services are launched by systemd. Since UpdateActivationEnvironment is not available on the system bus, this only applies to user buses. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-17bus_driver_handle_update_activation_environment: Error on system busesJan Alexander Steffens (heftig)1-0/+11
The default policy already disallows calls on system buses. Since any bus with a service helper cleans the environment anyway, there's no point in allowing this to be called. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-17fdpass test: assert that TCP connections don't say they can pass fdsSimon McVittie1-18/+58
As well as slightly increasing our test coverage, this ensures that at least one test-case in this test is not skipped, working around CMake's lack of support for the Automake-style exit code produced by GTest executables (they exit 77 if everything was skipped). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92887 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-11-16Fix recursive loop in backtrace generator on windows.Ralf Habacker1-1/+1
Backtrace generator called _dbus_warn(), which calls backtrace generator recursively with DBUS_FATAL_WARNINGS=1. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-13Do not fail with fatal message skipping GetConnectionUnixProcessID test-bus ↵Ralf Habacker1-1/+1
test on windows. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-13Fix test-bus test for GetConnectionUnixUser driver method on windows.Ralf Habacker1-4/+9
Because GetConnectionUnixUser is not supported on windows it fails with DBUS_ERROR_FAIL. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-12Skip launch helper activation tests on windows silently.Ralf Habacker1-3/+1
The system bus is unsupported there and Windows does not have any concept of setuid binaries, so it can't ever actually work. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-11Fix memory leak in _dbus_win_set_error_from_win_error().Ralf Habacker1-6/+1
There is no need to make a local (leaked) copy of the message, because dbus_set_error() already makes a copy of its parameters. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-11Fix memory leaks in bus_activation_service_reload_test() in case of errors.Ralf Habacker1-8/+9
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-11Revert "Fix memory leaks in bus_activation_service_reload_test() in case of ↵Ralf Habacker1-9/+8
errors." This reverts commit d8569ac647da4d62c7a251d8e809f2d545a77837.
2015-11-11Fix memory leaks in bus_activation_service_reload_test() in case of errors.Ralf Habacker1-8/+9
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: https://bugs.freedesktop.org/show_bug.cgi?id=92721
2015-11-11Fix test-bus segfault_service_no_auto_start test on windows.Ralf Habacker1-11/+16
Windows returns unhandled exceptions from a running child by specific exit codes and not by signals as on UNIX. Therefore we use DBUS_ERROR_SPAWN_CHILD_EXITED for propagating unhandled exceptions to the parent too. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-06update NEWSSimon McVittie1-1/+14
2015-11-06Fix test cases running client and server dispatch design issue.Ralf Habacker1-5/+34
DBus test cases running the server *and* client loop in the same process assumed that all messages send from the server has to be received in one client dispatch, which is not the case in all environments. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-06Fix bug unrefing connection too early in check_hello_message().Ralf Habacker1-2/+2
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-04Compile fix on Windows.Ralf Habacker1-1/+1
This commit fixes a regression introduced with commit 04b8a7a772cfa9ae8ea6ce452d1fb7f23e25fd3f.
2015-11-03Fix warning: variable 'ret' set but not used [-Wunused-but-set-variable].Ralf Habacker1-4/+7
Only set valid child status in case exit code has been gotten from child process, otherwise signal failure through thread return value. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-03Test system bus config files on Unix onlyRalf Habacker8-33/+94
Previously, we didn't consistently test parsing of every file in valid-config-files-system/ everywhere that we tested valid-config-files/. We now test it on Unix. The system bus is not supported on Windows, so we do not test valid-config-files-system/ there. valid-config-files/many-rules.conf contains <user> and <group> rules which are not applicable to Windows. Copy the original many-rules.conf to valid-config-files-system/ so that it will be tested on Unix, and remove the non-portable rules from valid-config-files/many-rules.conf. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> [rh:base patch came from Simon]
2015-11-02Don't use _dbus_warn() for intentionally-skipped testsSimon McVittie1-2/+5
The tests are run with _dbus_warn() fatal, so if a particular test is not applicable on the current platform, we shouldn't call it. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-11-02test_default_session_servicedirs: use the intended data directorySimon McVittie1-13/+22
If D-Bus was configured for /usr/local and built in Z:/build, the previous code would use Z:/build/dbus/.libs/usr/local/share/dbus-1/services whereas the intention was to replace the configured prefix /usr/local with the detected location, more like Z:/build/dbus/.libs/share/dbus-1/services Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-11-02test_default_session_servicedirs: simplify to a single exit code-pathSimon McVittie1-25/+20
A similar simplification was already done on master as part of commit f830e14, Bug #83539. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-11-02Fix warning: ISO C90 forbids mixed declarations and code ↵Ralf Habacker1-1/+2
[-Wdeclaration-after-statement]. Includes minor indention fix. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-02Fix typo and missing eol on debug message.Ralf Habacker1-1/+1
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-10-29refs test: reduce number of repeats under WineSimon McVittie1-32/+68
Under Wine, the API calls we use to do this are implemented via IPC to wineserver, which makes it unreasonably slow to try to brute-force bugs by having many threads stress-test refcounting. Do a few repetitions just to verify that refcounting basically works, but don't do the full stress-test. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> [rh: add WINESERVERSOCKET related hint]
2015-10-29When running TAP tests, filter out trailing \r from Windows .exeSimon McVittie1-1/+21
If we're running Windows executables using Wine, then tap-driver.sh won't accept "1..4\r\n" as TAP syntax. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-10-27Fix crash running test-syslog on windows/wine.Ralf Habacker1-3/+4
Use seperate buffer in _dbus_system_logv() to avoid crash in vsprintf(). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-10-27Display autolaunch scope on verbose print of daemon found message on windows.Ralf Habacker1-2/+2
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92080 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-10-261.10.3Simon McVittie2-1/+6
2015-10-261.10.2dbus-1.10.2Simon McVittie2-3/+5
2015-10-26Add a regression test for invalid BecomeMonitor callsSimon McVittie1-0/+151
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92298
2015-10-26NEWSSimon McVittie1-0/+7
2015-10-26user dbus.socket: Set DBUS_SESSION_BUS_ADDRESSJan Alexander Steffens (heftig)2-0/+7
As discussed in <https://github.com/systemd/systemd/issues/1600>. See also <https://bugs.archlinux.org/task/46721>, <https://bugzilla.gnome.org/show_bug.cgi?id=756420> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92612 [smcv: use AC_PATH_PROG to find systemctl; ignore systemctl failure] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> [smcv: add links to earlier bug reports elsewhere]
2015-10-26When running dbus-daemon --session in tests, override listen addressSimon McVittie1-12/+32
Otherwise, we can't reliably run tests for Windows, because the default listening address on Windows is "autolaunch:" which is global to a machine, resulting in testing an installed dbus-daemon instead of the one we intended to test. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-10-22Disable activation tests on Windows buildsSimon McVittie2-1/+20
These rely on the --systemd-activation code path, which is not compiled for Windows. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-10-21Keep cmake build system in sync with autotools (add test-monitor).Ralf Habacker1-0/+1
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92298 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-10-19NEWSSimon McVittie1-0/+5
2015-10-19BecomeMonitor: do not overwrite error with another errorSimon McVittie1-4/+1
If the user gave us a syntactically invalid error name, we'd overwrite the MatchRuleInvalid error with NoMemory, causing an assertion failure (crash) in the dbus-daemon. This is not a denial-of-service vulnerability on the system bus, because monitoring is a privileged action, and root privilege is checked before this code is reached. However, it's an annoying bug on the session bus. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92298 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-10-02NEWSSimon McVittie1-0/+9
2015-10-02On Windows, load local configuration relative to bus setupSimon McVittie6-22/+45
This makes an installed tree with /some-prefix/ etc/ dbus-1/ session-local.conf share/ dbus-1/ session.conf relocatable to any location. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92028 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Tested-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-10-02Cancel pending activation on any activation errorSimon McVittie1-25/+23
This fixes the error reporting if you make two attempts to activate a service that cannot be activated due to an error that is reported synchronously, such as a system service with no User= line in its .service file. This is easy to reproduce with the gdbus(1) tool, which sends an Introspect call in addition to the one you asked it to. If you try to activate a service using gdbus call --session -d com.example.FailToActivate \ -o / -m org.freedesktop.DBus.Peer.Ping then gdbus will actually send two method calls: one Introspect, and one Ping. The Introspect gets the correct error reply, but when dbus-daemon enters bus_activation_activate_service() for the Ping call, it sees that there is a pending activation and does an early-return. The pending activation does not finish until the timeout is reached. A couple of error cases handled this correctly, but the majority did not; make them all go into the same code path. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92200 Reviewed-by: Thiago Macieira <thiago@kde.org>
2015-09-30NEWSSimon McVittie1-1/+4
2015-09-30Fix creation of Exec path for files not in prefixMilan Crha1-5/+12
Doing strcat() into a static buffer produces incorrect results for the second and subsequent services if they are not in the ${prefix}; for example, if the first call should have returned "C:\bar\bin\service1" and the second should have returned "C:\bar\bin\service2", the second result would actually be "C:\bar\bin\service1C:\bar\bin\service2". Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83539 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> [smcv: added commit message; used strncpy/strncat to avoid overflow] Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-09-20Make Windows dbus-daemon look for the config file we installRalf Habacker3-69/+22
The canonical location for bus setup changed from ${sysconfdir}/dbus-1 to ${datadir}/dbus-1 (or their CMake equivalents) in version 1.9.18. Also stop trying to use bus/session.conf from the build tree, which will not work if our ${prefix} contains an older ${sysconfdir}/dbus-1/session.conf. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92028 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-09-17mention o.fd.DBus.Verbose in the NEWS tooSimon McVittie1-0/+2
2015-08-25start towards 1.10.2Simon McVittie2-1/+6
2015-08-251.10.0dbus-1.10.0Simon McVittie2-4/+14