summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-02-05tests: make installable metadata Windows-friendly by using EXEEXTSimon McVittie1-2/+2
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88980 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-02-05tests: make sure to specify CPPFLAGS where neededSimon McVittie1-0/+2
test-marshal and test-syntax need the $(testutils_shared_if_possible_cppflags), so that they will get the $(static_cflags) when we are not linking to dbus-glib. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88980 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-02-04bus_driver_check_caller_is_privileged: correct the DBUS_WIN caseSimon McVittie1-1/+1
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88964 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-02-04_dbus_listen_tcp_socket: Keep windows code to fetch port from tcp listening ↵Ralf Habacker1-6/+5
socket in sync with unix. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-02-04NEWS for 1.9Simon McVittie1-1/+28
2015-02-04Add a common test_init() for GLib tests which prevents hanging foreverSimon McVittie17-30/+54
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-04dbus-monitor: add options to log binary data with or without pcap framingSimon McVittie5-9/+202
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-04dbus-monitor: add support for using BecomeMonitor to be a read-only monitorSimon McVittie1-9/+75
Move the dbus_connection_add_filter() call further up as a precaution, because it isn't safe for a monitor to not have a filter that swallows all messages. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-04Allow root to monitor the system bus by defaultSimon McVittie1-0/+6
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-04Add a regression test for being a new-style monitorSimon McVittie3-0/+1526
This includes most of the situations I could think of: * method call on dbus-daemon and response * NameOwnerChanged * NameAcquired, NameLost (although I'm not 100% sure these should get captured, since they're redundant with NameOwnerChanged) * unicast message is allowed through * unicast message is rejected by no-sending or no-receiving policy * broadcast is allowed through * broadcast is rejected by no-sending policy (the error reply is also captured) * broadcast is rejected by no-receiving policy (there is no error reply) * message causing service activation, and the message telling systemd to do the actual activation * systemd reporting that activation failed It does not cover: * sending a message to dbus-daemon, then provoking a reply, then dbus-daemon does not allow itself to send the reply due to its own security policy This is such an obscure corner case that I'm not even convinced it's testable without dropping down into lower-level socket manipulation: dbus-daemon's replies are always assumed to be requested replies, and replies contain so little other metadata that I think we can only forbid them by forbidding all method replies. If we do that, the reply to Hello() won't arrive and the client-side connection will not become active. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-04Capture a fake reply if a broadcast cannot be deliveredSimon McVittie3-4/+37
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-04Capture all messages received or sent, and send them to monitorsSimon McVittie6-34/+417
Unlike eavesdropping, the point of capture is when the message is received, except for messages originating inside the dbus-daemon. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-04Add support for morphing a D-Bus connection into a "monitor"Simon McVittie5-1/+199
This is a special connection that is not allowed to send anything, and loses all its well-known names. In future commits, it will get a new set of match rules and the ability to eavesdrop on messages before the rest of the bus daemon has had a chance to process them. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-04Merge branch 'dbus-1.8'Simon McVittie0-0/+0
2015-02-04Prepare embargoed 1.8.16 releaseSimon McVittie2-4/+18
2015-02-04CVE-2015-0245: prevent forged ActivationFailure from non-root processesSimon McVittie1-0/+8
Without either this rule or better checking in dbus-daemon, non-systemd processes can make dbus-daemon think systemd failed to activate a system service, resulting in an error reply back to the requester. This is redundant with the fix in the C code (which I consider to be the real solution), but is likely to be easier to backport. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88811 Reviewed-by: Alban Crequy Reviewed-by: David King Reviewed-by: Philip Withnall
2015-02-04NEWS for 1.8 branchSimon McVittie1-1/+7
2015-02-04_dbus_listen_tcp_socket: comment on another reason to ignore EADDRINUSESimon McVittie1-3/+12
Not being aware of the second reason described here caused bug #87999 in the equivalent code on Windows. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999
2015-02-04_dbus_listen_tcp_socket: use NI_NUMERICSERV to determine port numberSimon McVittie1-1/+1
If we happen to have been given (say) port 30865, we want to represent that as host=localhost,port=30865 and not host=localhost,port=csync2. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999
2015-02-04Provide appropriate DBUS_USER and DBUS_TEST_USER under CMakeRalf Habacker2-3/+6
[separated out from a larger commit -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88964 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-02-04Link tests to test-utils-glib.c under CMake tooRalf Habacker1-1/+9
[Separated out from a larger commit -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88964 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-02-04dbus-monitor: use common code from dbus-test-toolSimon McVittie3-13/+12
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall [also sync up the cmake build system -smcv]
2015-02-031.9.9Simon McVittie2-1/+6
2015-02-03Imported Upstream version 1.9.8upstream/1.9.8Simon McVittie5-36/+5
2015-02-031.9.8 development releaseSimon McVittie2-4/+6
2015-02-03Treat root as a valid candidate for TEST_USER_MESimon McVittie2-15/+4
If spawn_dbus_daemon() can fail for TEST_USER_ME, then we'd have to go through all the tests adding the ability to skip tests after it fails, which is a fairly extensive change. The tests have historically all run as whatever uid is supplied, and if the tests are being run as root for some reason - perhaps in a CI framework for an embedded platform that doesn't have non-root users, or in an environment where you can be root or non-root but not both - there is no particular reason to skip them.
2015-02-03Imported Upstream version 1.9.8Simon McVittie48-744/+2087
2015-02-03NEWSSimon McVittie1-0/+8
2015-02-03Add a regression test for systemd activationSimon McVittie8-0/+363
4.5 years after it was implemented, here is the regression test. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57952 Reviewed-by: Philip Withnall
2015-02-03bus_context_log_and_set_error: add and useSimon McVittie4-25/+39
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03_dbus_set_error_valist: addSimon McVittie2-6/+24
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03bus_context_log_literal: add simplified version of bus_context_logSimon McVittie2-1/+24
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03bus: put the printf attribute in the header where it will do more goodSimon McVittie2-4/+1
Now we can actually notice incorrect format strings in other translation units. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03bus driver: factor out bus_driver_check_caller_is_privileged, and allow rootSimon McVittie2-32/+110
Unlike the initial mitigation for CVE-2014-8148, we now allow uid 0 to call UpdateActivationEnvironment. There's no point in root doing that, but there's also no reason why it's particularly bad - if an attacker is uid 0 we've already lost - and it simplifies use of this function for future things that do want to be callable by root, like BecomeMonitor for #46787. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03Add a test for uid-controlled permissionsSimon McVittie5-0/+311
This is technical debt from mitigating CVE-2014-8148, which should really have had a regression test at the time. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03Add infrastructure to run bits of tests under an alternative uidSimon McVittie5-12/+153
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03test: implement GLib-style "installed tests"Simon McVittie2-6/+34
We run each test twice: * once with the system's session.conf, as an integration test (test-cases that need a special configuration are automatically skipped) * once with our special test configuration files, which provide better coverage Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03Generate test configuration files via build-time sed, not configureSimon McVittie2-25/+64
This means we can generate a version that works when installed, from the same source files. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03Factor out some utility functions from test/dbus-daemon*Simon McVittie7-350/+330
In the process, make test_kill_pid() safer: do not try to terminate more than one pid, or the NULL handle. Also stop leaking the address_fd in spawn_dbus_daemon, a pre-existing bug that was spotted by Philip Withnall during review. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03Bump required GLib version to 2.36Simon McVittie3-9/+2
This is for g_close(), which the next commit will use. It also lets us rely on g_type_init() being a no-op (since 2.32 the type system is always initialized by a global constructor). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03Update .gitignore filesLukasz Skalski3-0/+6
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88943 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-02-02NEWSSimon McVittie1-1/+31
2015-02-02lcov: use builddir, not srcdirSimon McVittie1-2/+2
It seems lcov (or gcc?) has changed its paths since last time this worked. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88808 Reviewed-by: Philip Withnall
2015-02-02Enable subdir-objects Automake optionSimon McVittie1-1/+1
It has been supported since at least 1.10, and its absence is deprecated since 1.14. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88808 Reviewed-by: Philip Withnall
2015-02-02bus: exit on fatal errors even if not sysloggingSimon McVittie1-0/+4
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88808 Reviewed-by: Philip Withnall
2015-01-30Fix 'dbus-daemon on Windows: Failed to bind socket "localhost:xxxx": Address ↵Ralf Habacker1-2/+14
already in use'. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-01-30In _dbus_listen_tcp_socket() set socket family to ipv4 in unspecified case ↵Ralf Habacker1-1/+1
for now. This fix is required to support at least ipv4 tcp support calling _dbus_listen_tcp_socket() without family. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-01-30Add manual tcp test case.Ralf Habacker3-1/+57
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-01-29_dbus_string_append_printf_valist: avoid leaking copy of varargsSimon McVittie1-5/+6
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88087 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-01-27Use pygi instead of pygobject 2Simon McVittie3-9/+9
pygobject 2 is obsolete and unmaintained, and anyway this is for optional functionality (full regression test coverage) rather than anything that will be needed in production builds. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85969