summaryrefslogtreecommitdiff
path: root/bus
AgeCommit message (Collapse)AuthorFilesLines
2012-10-04activation helper: when compiled for tests, do not reset system bus addressSimon McVittie1-1/+1
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-09-28activation-helper: Ensure DBUS_STARTER_ADDRESS is set correctlyGeoffrey Thomas1-11/+5
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-28hardening: Remove activation helper handling for DBUS_VERBOSEColin Walters1-13/+1
It's not really useful. See https://bugs.freedesktop.org/show_bug.cgi?id=52202#c17
2012-08-13Revert "Split DBUS_SESSION_BUS_DEFAULT_ADDRESS into listen, connect ↵Simon McVittie1-1/+1
addresses and set better defaults" This reverts commit b5d36dc27d1905d4d46ad7f0097f0ea0e0776adb. On second thoughts, this is too big a change for a stable branch.
2012-08-13Split DBUS_SESSION_BUS_DEFAULT_ADDRESS into listen, connect addresses and ↵Simon McVittie1-1/+1
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-04-12Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication methodDavid Zeuthen2-17/+17
When libdbus-1 moved to using monotonic time support for the DBUS_COOKIE_SHA1 authentication was broken, in particular interoperability with non-libdbus-1 implementations such as GDBus. The problem is that if monotonic clocks are available in the OS, _dbus_get_current_time() will not return the number of seconds since the Epoch so using it for DBUS_COOKIE_SHA1 will violate the D-Bus specification. If both peers are using libdbus-1 it's not a problem since both ends will use the wrong time and thus agree. However, if the other end is another implementation and following the spec it will not work. First, we change _dbus_get_current_time() back so it always returns time since the Epoch and we then rename it _dbus_get_real_time() to make this clear. We then introduce _dbus_get_monotonic_time() and carefully make all current users of _dbus_get_current_time() use it, if applicable. During this audit, one of the callers, _dbus_generate_uuid(), was currently using monotonic time but it was decided to make it use real time instead. Signed-off-by: David Zeuthen <davidz@redhat.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48580
2012-03-22test: enforce own_prefix policy rulesAlban Crequy3-8/+90
After parsing [allow|deny] rules with own_prefix, check they are enforced correctly. https://bugs.freedesktop.org/show_bug.cgi?id=46886
2012-03-22policy: remove unused parameterAlban Crequy3-4/+1
2012-03-04policy: enforce policy on "allow own_prefix"Alban Crequy1-1/+14
https://bugs.freedesktop.org/show_bug.cgi?id=46886
2012-03-04config parser: add own_prefixAlban Crequy2-21/+38
https://bugs.freedesktop.org/show_bug.cgi?id=46882
2012-02-21Move _dbus_check_fdleaks_enter to dbus-message-internal.hSimon McVittie1-1/+1
This means the bus test can use them without needing dbus-message-private.h, reducing its view of message internals. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46095 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2012-02-13Replace a series of booleans, all (apparently) alike, with flagsSimon McVittie4-38/+63
This makes it a bit clearer what's going on. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
2012-02-10Merge branch 'system-search-paths-21620'Simon McVittie1-2/+2
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=21620 Reviewed-by: Lennart Poettering <lennart@poettering.net>
2012-02-10bus: introduce --nopidfile switch to disable writing of PID filesLennart Poettering5-6/+17
When used with init systems such as systemd (where PID files are redundant) this allows us to disable PID files even if a path is configured for them in the normal bus configuration files. Make use of this new switch in the systemd unit file. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45520 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-02-08Explicitly don't search XDG_DATA_DIRS for system services, and document itSimon McVittie1-2/+2
In practice, it never works, because the activation helper doesn't respect environment variables for security reasons. If you want to vary the search path, alter system.conf instead, to replace or augment <standard_system_servicedirs/> with your preferred search path. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=21620 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-02-07systemd: drop machine UUID generation for unit fileLennart Poettering1-1/+0
To optimize startup a bit, drop machine UUID generation from the unit file. Since a while D-Bus was already capable of making use of the /etc/machine-id file, which is guaranteed to exist on systemd systems (since the first released versions already), hence there's no need to ever generate a D-Bus specific machine ID. In times where userspace takes < 800ms to boot up getting rid of this process optimizes boot time further. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45520 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-02-07Merge branch 'socket-set-33337'Simon McVittie4-4/+42
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33337
2012-01-23Merge branch 'dbus-1.4', rejecting commit 08dd53c14b53b88cSimon McVittie1-0/+1
2012-01-23Revert addition of files which were only meant to exist on master, tooSimon McVittie2-390/+0
This completes the reversion started in 5df8c3db12590edd68e968.
2012-01-23dbus-daemon: fix forgotten counter increase while copying configured auth ↵Simon McVittie1-0/+1
mechanisms Previously, only one auth mechanism was used. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45106 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-01-04Revert "made session service dirs customizable: cmake part"Simon McVittie1-1/+1
This reverts commit 89e453216c02bb85c5e53d459997f8bc3b2c73d4. It makes the tests fail under autotools.
2012-01-04Revert "made session service dirs customizable: autotools part"Simon McVittie1-2/+0
This reverts commit 61760cf7de5af3452423244a8b6f5f1b5d00512b.
2012-01-04Revert all changes since a36d4918a6f646e085Simon McVittie20-922/+468
Someone seems to have merged part of master into 1.4. Again. Let's go back to the "last known good" point (the branch-point of some 1.4 branches I had locally), then we can cherry-pick the changes that should have gone in.
2011-11-21made session service dirs customizable: autotools partRalf Habacker1-0/+2
2011-11-21made session service dirs customizable: cmake partRalf Habacker1-1/+1
2011-09-28Merge tests' cmake and autotools bus configurationSimon McVittie1-19/+12
In Unix, the tests listened on both debug-pipe (which is a socketpair, or a TCP emulation of socketpair on Windows) and a Unix socket. In the Windows port, the tests were hard-coded to listen on a particular port, which allowed the dispatch test to connect to that port, as long as no two tests ran simultaneously (which I don't think was ever guaranteed - make -j can violate this). That's valid out-of-process, and also fully-specified, so they only needed one <listen> directive, so the CMake input only had one. To make the tests work under CMake on Unix, there was a hack: the string substituted for the content of the <listen> directive contained </listen><listen> to get the other address in, which is pretty nasty. Instead of doing that, I've made both build systems, on both Unix and Windows, use both debug-pipe and a more normal transport (Unix or TCP). debug-pipe has a Windows implementation and it's used in dbus-spawn-win.c, so it'd better work. The use of debug-pipe is now hard-coded rather than being a configure parameter (there's no reason to vary it in different builds), and I used TEST_LISTEN as the name of the Unix/TCP address, because it's a "vague" address (no specific Unix path, no TCP port), that you can listen on but not connect to. This in turn means that we can merge the Autoconf .in and CMake .cmake files, similar to Bug #41033. You might wonder why I've kept debug-pipe. I did try to get rid of it, but it turns out that the tests in dispatch.c rely on dbus_connection_open_private() not blocking, and normal socket connections block on connect(). Until we fix that by adding an async version of dbus_connection_open_private(), it won't be safe to have a test like dispatch.c that "talks to itself", unless it uses a transport as trivial as debug-pipe in which neither end has to block on the other. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41222
2011-09-21Merge branch 'more-unused-39231'Simon McVittie6-45/+25
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21Merge branch 'remove-stub-tests-41012'Simon McVittie3-25/+0
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41012 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21Merge branch 'dbus-1.4'Simon McVittie1-4/+7
Conflicts: NEWS
2011-09-21update_desktop_file_entry: initialize return value properly, and actually ↵Simon McVittie1-1/+2
return it Since 1.4.4 (commit 75cfd97f) this function always returned FALSE. As far as I can see this was actually harmless, because both of its callers ignore any error that is not NoMemory (and treat it the same as success). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39230 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21update_desktop_file_entry: if the service name already existed, set errorSimon McVittie1-1/+4
If we're going to return FALSE for this (which has apparently always been the case), then we should set an error properly. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39230 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21update_desktop_file_entry: don't leak file_path on one particular OOMSimon McVittie1-2/+1
Revenge of #33126: most, but not all, temporary variables were freed on this code path. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39230 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-19bus_policy_test: remove stubSimon McVittie3-25/+0
2011-09-19Use {}, not semicolon, when the statement of an "if" does nothingSimon McVittie1-2/+6
The uses in bus/activation.c are also probably wrong because they ignore the result of the test, but that's orthogonal. (<https://bugs.freedesktop.org/show_bug.cgi?id=39858>)
2011-09-19Fix an assortment of variables that aren't used when not checking/assertingSimon McVittie1-8/+15
2011-09-19BusConnections: don't assert about BusConnectionData in functions that don't ↵Simon McVittie1-11/+0
need it
2011-09-19bus_driver_handle_message: remove unused labelSimon McVittie1-1/+0
2011-09-19activation helper: remove unused variable when not being verboseSimon McVittie1-2/+2
2011-09-19bus_registry_acquire_service: remove unnecessary variableSimon McVittie1-5/+2
2011-09-19Remove a never-used callbackSimon McVittie1-8/+0
2011-09-19Remove more never-used variablesSimon McVittie1-8/+0
2011-08-26Merge branch 'dbus-1.4'Simon McVittie1-2/+5
2011-08-26Don't build any of the reload-pipe code on non-UnixSimon McVittie1-2/+5
In commit ab7b3f9, Ralf notes that handle_reload_watch() is (in principle) cross-platform. However, there's no way to trigger it on Windows, because nothing ever writes to the pipe. Make the entire pipe-to-self trick Unix-specific instead. Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40002
2011-08-13Fix compilation on MSVC, which doesn't understand "inline" with its C99 meaning.Ralf Habacker1-6/+1
This fix is limited to msvc compilers only. Reviewed-by:Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-08-11capng: Drop supplemental groups when switching to daemon userSteve Grubb1-1/+1
This patch ensures the daemon process doesn't inherit any supplemental groups for the root user from an administrator login via an init script. This is only an issue for pre-systemd systems. https://bugzilla.redhat.com/show_bug.cgi?id=726953
2011-08-05Win32 compile fix.Ralf Habacker1-1/+6
msvc compilers define 'inline' only for c++ code, so wrap it with a platform independent DBUS_INLINE define in cmake generated config.h.
2011-08-05Win32 compile fix.Ralf Habacker1-1/+1
Do not limit ACTION_RELOAD to unix only because it is used in the crossplattform function handle_reload_watch().
2011-08-05Merge branch 'dbus-1.4'Simon McVittie1-9/+75
Conflicts: bus/main.c
2011-08-05bus signal_handler: call _exit in the unlikely event that the pipe is full ↵Simon McVittie1-2/+8
or invalid On OSs with abstract sockets, this is close enough. On OSs without abstract sockets, this results in failing to clean up Unix sockets in /tmp if someone has sent us thousands of SIGHUP signals since we last entered the main loop - I think that's acceptable. The reload pipe should never get closed, but if it is for some reason, we want a SIGTERM after that to cause an exit too. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38656 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-08-05bus signal_handler: comment why it's OK if the reload pipe gets fullSimon McVittie1-0/+13
Backported to dbus-1.4, originally part of commit c7ef3ead558e147. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33336 Reviewed-by: Thiago Macieira <thiago@kde.org>