summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Update NEWSSimon McVittie2018-08-021-0/+12
|
* nonce: Don't try to rmdir(NULL) on OOMSimon McVittie2018-08-021-1/+1
| | | | | | | | | | | If re-initializing the string fails, it will be left in a state where it has a length of 0 and a NULL buffer. That's valid to "free", but not valid to pass to rmdir(). Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107194 (cherry picked from commit 294e8b0b672c8ffdcb8d9227f114846433659864)
* dbus_server_listen: Don't leak first_connect_errorSimon McVittie2018-08-021-0/+1
| | | | | | | | | | | If an implementation fails to listen, and a subsequent implementation succeeds, then we would have leaked this. Detected by running tests/loopback.c under valgrind. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107194 (cherry picked from commit b14a4517a82f7e7e4c0b59cb663ebf77563decda)
* sysdeps: Reassure gcc 8 that we are not overflowing struct sockaddr_unSimon McVittie2018-08-021-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using strncpy (buffer, str, strlen (str)) is a "code smell" that might indicate a serious bug (it effectively turns strncpy into strcpy), and gcc 8 now warns about it. In fact we avoided the bug here, but it wasn't at all obvious. We already checked that path_len is less than or equal to _DBUS_MAX_SUN_PATH_LENGTH, which is 99, chosen to be strictly less than the POSIX minimum sizeof(sun_path) >= 100, so we couldn't actually be overflowing the available buffer. The new static assertion in this commit matches a comment above the definition of _DBUS_MAX_SUN_PATH_LENGTH: we define _DBUS_MAX_SUN_PATH_LENGTH to 99, because POSIX says struct sockaddr_un's sun_path member is at least 100 bytes (including space for a \0 terminator). dbus will now fail to compile on platforms that are non-POSIX-compliant in this way, except for Windows. We zeroed the struct sockaddr_un before writing into it, so stopping one byte short of the end of sun_path ensures that we get \0 termination. Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107350 Reviewed-by: Thiago Macieira <thiago@kde.org> Reviewed-by: Philip Withnall <withnall@endlessm.com> (cherry picked from commit f429631365ba59a1749438af2184cab138a31772)
* build: Disable new gcc 8 warning -Wcast-function-typeSimon McVittie2018-08-021-1/+5
| | | | | | | | | The foreach(list, (DBusForeachFunction) free, NULL) idiom seems too entrenched to remove it from stable branches. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107349 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Thiago Macieira <thiago@kde.org>
* Update NEWSSimon McVittie2018-06-041-1/+8
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Skip TCP tests if getaddrinfo doesn't workSimon McVittie2018-06-047-3/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example, this can be the case in bubblewrap or Debian pbuilder after unsharing the network namespace: bwrap \ --bind / / \ --dev-bind /dev /dev \ --bind /dev/shm /dev/shm \ --bind /dev/pts /dev/pts \ --unshare-net \ ${builddir}/test/test-loopback --tap ... ok 1 /connect/tcp # SKIP Name resolution does not work here: getaddrinfo("127.0.0.1", "0", {flags=ADDRCONFIG, family=INET, socktype=STREAM, protocol=TCP}): Name or service not known On some systems this can be circumvented by using nss_wrapper from <https://cwrap.org/nss_wrapper.html>: cat > hosts <<EOF 127.0.0.1 localhost EOF bwrap \ ... \ env \ LD_PRELOAD=libnss_wrapper.so \ NSS_WRAPPER_HOSTS=$(pwd)/hosts \ ${builddir}/test/test-loopback --tap ... # listening at tcp:host=127.0.0.1,port=39219,family=ipv4,guid=... but for systems where that does't work, we should be prepared to skip the affected tests. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106812 (cherry picked from commit f1faafd59bec67d347edb10447c4b9b18193458c)
* server-oom test: Don't assume localhost is resolvableSimon McVittie2018-06-041-4/+4
| | | | | | | | | | Pathological autobuilder environments might not list localhost in /etc/hosts. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106812 (cherry picked from commit 4cfc7de30de7111f589501e5b597063aeb96cf28)
* test: Test the same things with unix: that we do with tcp:Simon McVittie2018-06-045-7/+32
| | | | | | | | | | | | | | | Minimal autobuilder environments don't always have working TCP, so we may need to skip TCP tests. Make sure we test the equivalent code paths via Unix sockets in those environments. One notable exception is test/fdpass.c, which uses TCP as a transport that is known not to be able to carry Unix fds; this needs to continue to use TCP. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106812 (cherry picked from commit cb7dd5bfccb2882d0e9951c41040ff6a97bb827d)
* server-oom test: Parse the address instead of going directly to TCPSimon McVittie2018-06-041-23/+7
| | | | | | | | | | This expands test coverage, and lets us reuse the test for other address schemes. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106812 (cherry picked from commit b19c9e2f265878801bc48866a7cc3152ca2ad45e)
* sysdeps-unix: Handle errors from getaddrinfo correctlySimon McVittie2018-06-041-5/+65
| | | | | | | | | | | | | | | | | | getaddrinfo and getnameinfo have their own error-handling convention in which the library call returns either 0 or an EAI_* error code unrelated to errno. If the error code is not EAI_SYSTEM, then the value of errno is undefined (in particular it might be carried over from a previous system call or library call). Introduce a new helper function _dbus_error_from_gai() to handle this. The equivalent code paths in Windows appear to be OK: the Windows implementation of getaddrinfo() is documented to return a Winsock error code, which we seem to be handling correctly. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106395 (cherry picked from commit 60cedd0cfd775c9fcf7260e12af9b2ffeefc2bbe)
* Start 1.12.10 developmentSimon McVittie2018-04-302-1/+6
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* 1.12.8dbus-1.12.8Simon McVittie2018-04-302-3/+3
|
* build: Uninstall JavaScript and CSS from htmldirSimon McVittie2018-04-271-0/+2
| | | | | | | Otherwise, distcheck fails when mallard-ducktype is available. Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 9391d769ae335872e5b770f6741855fde45b8186)
* Preallocate release nameSimon McVittie2018-04-251-0/+2
|
* NEWS: Mention non-local TCP tooSimon McVittie2018-04-251-2/+2
| | | | | Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 2390a325a0f094a87065e6dcfdf99c188a5b360f)
* Update NEWSSimon McVittie2018-04-251-0/+5
| | | | (cherry picked from commit ee0e42ae2d157a5d4c9d5f1a9114632897bc47ad)
* dbus-daemon(1): Mention and deprecate shared session busesSimon McVittie2018-04-251-0/+13
| | | | | | | | | | | | | | | | This might (?) have made sense behind a firewall in 2003; but now it's 2018, the typical threat model that we are defending against has changed from "vandals want to feel proud of their l33t skills" to "organised crime wants your money", and a "trusted" local LAN probably contains an obsolete phone, tablet, games console or Internet-of-Things-enabled toaster with remote root exploits. This make network topologies that used to be acceptable look increasingly irresponsible. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> (cherry picked from commit d0a16b59a8572fbd1934e941e2e3004840306222)
* dbus-daemon(1): Recommend requiring EXTERNAL on non-Windows OSsSimon McVittie2018-04-251-0/+4
| | | | | | | | | | | | This is the default, and blocks TCP-based attacks by making the attacker fail to authenticate (while also preventing inadvisable TCP-based configurations from working). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Reviewed-by: Philip Withnall <withnall@endlessm.com> (cherry picked from commit aef4475939a773e1a205a71d641ea2bb6793ab92)
* dbus-daemon(1): Put some scary warnings on <allow_anonymous/>Simon McVittie2018-04-251-0/+7
| | | | | | | | | | | I'm far from convinced that this option should even *exist*, but it should definitely be documented as a very bad thing. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Reviewed-by: Philip Withnall <withnall@endlessm.com> (cherry picked from commit 5d3680486712891c13b85c07fab629bb70f623cc)
* dbus-daemon(1): Recommend against remote TCP for debuggingSimon McVittie2018-04-251-0/+10
| | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: Add a TODO comment as suggested] Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit cf47380641aac0e5b40694b0ae09ffb85ec4b5fc)
* dbus-daemon(1): Say that non-local TCP is insecureSimon McVittie2018-04-251-2/+22
| | | | | | | | | | | | | | With some fairly reasonable threat models (active or passive local attacker able to eavesdrop on the network link, confidential information being transferred via D-Bus), secure authentication is insufficient to make this transport secure: it does not protect confidentiality or integrity either. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Reviewed-by: Philip Withnall <withnall@endlessm.com> (cherry picked from commit 2513f84db68a9edad8558806b777ed6c284016b9)
* Update NEWS for 1.12.x branchSimon McVittie2018-04-231-0/+13
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* doxygen_to_devhelp: Produce Devhelp index format v2Simon McVittie2018-04-233-3/+9
| | | | | | | | | | The old version-1 format is deprecated and now produces warnings. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106186 Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: Add the .devhelp2 file to .gitignore as suggested] Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit fa922639207de16d459983144ddad28b7abe60c2)
* doxygen_to_devhelp: Make the API reference the front pageSimon McVittie2018-04-231-1/+2
| | | | | | | | | | | | | The tutorial is not necessarily a great entry point for the libdbus documentation: it's infrequently updated, and we should probably have the "If you use this low-level API directly, you're signing up for some pain" message from the API reference show up in devhelp more immediately. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106186 Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: Add longer commit message with rationale] Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit c84ac8b1ef3a9fa18127b2462ead369c4e8846bd)
* doc: Install highlight.pack.js if presentSimon McVittie2018-04-232-0/+2
| | | | | | | | | | | Newer versions of yelp-build use this instead of a jQuery syntax highlighter. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106171 Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: Also add it to .gitignore as suggested] Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 49ad5b110fd5f5f4e41405d98007a11d8eb741f7)
* doc: Only install ancillary files from yelp-build if they existSimon McVittie2018-04-231-3/+14
| | | | | | | | | Newer versions of yelp-build don't install jquery. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106171 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> (cherry picked from commit bab857fb6f75ffe0ac3771de4b8272ad97623a2c)
* 1.12.6dbus-1.12.6Simon McVittie2018-03-012-3/+5
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Clarify NEWS entry with implications of fd.o#105165Simon McVittie2018-02-231-1/+3
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Update NEWS for #105165Simon McVittie2018-02-201-1/+5
| | | | | Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit c62a20624e4616e7fa84427c54f3653312a7edb5)
* Add a unit test for the dbus-daemon resetting its fd limitSimon McVittie2018-02-207-15/+141
| | | | | | | | Reviewed-by: David King <dking@redhat.com> [smcv: Fix typo in cmake macro name] Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105165 (cherry picked from commit 49ca421997d91d3e01626b2c92a826e6a5db0b2f)
* cmake: Check for getrlimit, setrlimitSimon McVittie2018-02-202-0/+4
| | | | | | | | | | This gives us feature parity with the Autotools build system for this particular area, and in particular means a system dbus-daemon built with cmake can expand its fd limit. Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105165 (cherry picked from commit a146724f2f7610bc0a968d03a3f20481c03a6a37)
* bus: raise fd limits before dropping privsDavid King2018-02-201-2/+5
| | | | | | | | | | | | | | | | | Startup ordering was changed in #92832 to ensure that SELinux audit messages could be sent. As a side effect, the raising of file descriptor limits was moved to after the dropping of root privileges, resulting in the limit change always failing. Move the raise_file_descriptor_limit() call to ensure that it is called before dropping root privileges. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105165 Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1529044 [smcv: Call raise_file_descriptor_limit() even if !context->user] Reviewed-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 6e42964f5f850f4108fd8f7f3cd385ab4d60f9f6)
* Start towards 1.12.6Simon McVittie2018-02-082-1/+6
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* 1.12.4dbus-1.12.4Simon McVittie2018-02-082-3/+5
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Add NEWS for #104925Simon McVittie2018-02-081-0/+2
| | | | | Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 93433970e9c5a5d0b7f92a37174b40624c711475)
* doc: Fix bracket escaping in Ducktype API design filePhilip Withnall2018-02-081-22/+22
| | | | | | | | | | | | | There’s no need to escape closing brackets if the paired opening bracket is escaped (or doesn’t need escaping). See https://github.com/projectmallard/mallard-ducktype/issues/16#issuecomment-362590519. Signed-off-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104925 Reviewed-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit ad72d6bc5f45e78d21f64099f670a89dcf32507d)
* Add NEWS for #102839Simon McVittie2018-02-081-0/+7
| | | | | Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 705db4455d482edba52d0af3fe57521da9d33e86)
* Add new test for waiting on pending calls in threadsSimon McVittie2018-02-073-0/+307
| | | | | | | | | | | | | Based on code contributed by Manish Narang. This is not included in the automated test suite, because it isn't reliable on heavily-loaded automatic test infrastructure like Travis-CI. Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: Add the test to the CMake build system too, as requested] [smcv: Convert into a manual test] Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839 (cherry picked from commit 0b1e2928606e0cf138c38e75eb248d2ed19bff15)
* Add a simplified backport of g_steal_pointer()Simon McVittie2018-02-072-1/+16
| | | | | | | | | | | | | | | This will be used in tests later in the branch. Sadly we can't use GLIB_VERSION_2_44 unless we are willing to have a hard dependency on GLib 2.44, which would force us to do all our Travis-CI builds in Docker containers rather than in ye olde base system, and that adds 50% to the time taken to do builds. Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: Rebase onto 1.13.x branch, fix minor conflicts] Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354 (cherry picked from commit d5742550ca566317eaddea0ff7db04098f9f044f)
* cmake: Match AC_DEFINE more precisely, respecting [] quotingSimon McVittie2018-02-072-1/+4
| | | | | | | | | | | | | | | | The regular expression previously used here to select the second comma-delimited argument won't work when we introduce an argument containing a comma, which I need to do now. We can address this by recognising Autoconf's quoting mechanism (which uses square brackets). This is not 100% right (it doesn't understand nested square brackets), but it's good enough in practice. Signed-off-by: Simon McVittie <smcv@collabora.com> Acked-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354 (cherry picked from commit 83b439f7b4c6a946e0fe9a0287910ba4f6318143)
* tests: Add the ability to multiply up test timeoutsSimon McVittie2018-02-065-11/+12
| | | | | | | | | Tests that brute-force OOM code paths can be rather slow. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100317 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 5c91d85f3ed462dac1e011aab216c9021e826773)
* test_connect_to_bus: Allow skipping the use of a DBusLoopSimon McVittie2018-02-061-1/+3
| | | | | | | | | | | DBusLoop isn't thread-safe, so we can't use it to test multi-threaded situations. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> (cherry picked from commit f127c8e110faed76039f96dbc53a87f093fea312) [smcv: Adjust for older codebase]
* DBusPendingCall: Improve doc-comments around completed flagSimon McVittie2018-02-061-2/+19
| | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> (cherry picked from commit 57a0cf1d14c20765bfc7a36234955b14f3811f2a)
* DBusPendingCall: Only update ->completed under the connection lockManish Narang2018-02-063-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | If one thread is blocking on a pending call, and another thread is dispatching the connection, then we need them to agree on the value of the completed flag by protecting all accesses with a lock. Reads for this member seem to have the connection lock already, so it's sufficient to make sure that the only write also happens under the connection lock. We already set the completed flag before calling the callback, so it seems OK to stretch it to meaning that some thread has merely *taken responsibility for* calling the callback. The completed flag shares a bitfield with timeout_added, but that flag is protected by the connection lock already. Based on suggestions from Simon McVittie on <https://bugs.freedesktop.org/show_bug.cgi?id=102839>. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839 [smcv: Revert indentation changes; add commit message] Reviewed-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit d3e03eb50eefa5a38d87f274c7de73f36468459c)
* DBusConnection: Pass a pending call around more oftenManish Narang2018-02-061-1/+1
| | | | | | | | | | | | | | | | | | If a pending call is provided, _dbus_connection_do_iteration_unlocked checks whether it has completed or has a reply ready as soon as it acquires the I/O path. If that's the case, then the iteration terminates without trying to carry out I/O, so that the pending call can be dispatched immediately, without blocking until a timeout is reached. This change is believed to be necessary, but not sufficient, to resolve #102839. Based on part of a patch from Michael Searle on <https://bugs.freedesktop.org/show_bug.cgi?id=102839>. Commit message added by Simon McVittie. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839 Reviewed-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 30f8a38b3c8f8756744d6b65dd8207302a683acc)
* NEWS: Mention systemd < 237 here tooSimon McVittie2018-01-291-2/+2
| | | | | Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 38dea203a5514dc4b4e858fce0b6957d4cf116ab)
* tmpfiles: Add a note that one line is not needed with newer systemdSimon McVittie2018-01-291-1/+1
| | | | | Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 8fd30736917e36b5eb69167dc3ef23be74f76039)
* travis-ci: Get autoconf-archive from Debian 9 'stretch'Simon McVittie2018-01-291-1/+1
| | | | | Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit acb775a92b1c554f251de129c7e51db19522b65e)
* Update NEWS for #104577Simon McVittie2018-01-111-0/+4
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>