]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
7 years agoNEWS: Note cmake fixes that might be cherry-picked to dbus-1.12
Simon McVittie [Mon, 22 Oct 2018 14:17:15 +0000 (15:17 +0100)] 
NEWS: Note cmake fixes that might be cherry-picked to dbus-1.12

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agocmake: Fix incorrect header list separator in configure checks
Ralf Habacker [Mon, 22 Oct 2018 07:27:30 +0000 (09:27 +0200)] 
cmake: Fix incorrect header list separator in configure checks

CMake expects a semicolon-separated list of headers, not a
space-separated list. In particular, this meant we failed to detect
getpwnam_r() on Linux, and fell back to getpwnam().

Reviewed-by: Simon McVittie <smcv@collabora.com>
7 years agoUpdate NEWS
Simon McVittie [Mon, 22 Oct 2018 11:59:05 +0000 (12:59 +0100)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoUpdate bug reporting URLs to use freedesktop.org Gitlab
Simon McVittie [Mon, 22 Oct 2018 11:47:53 +0000 (12:47 +0100)] 
Update bug reporting URLs to use freedesktop.org Gitlab

The README change reuses text from CONTRIBUTING.md.

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoci: Clarify why we are running autogen.sh even for CMake builds
Simon McVittie [Mon, 22 Oct 2018 11:43:49 +0000 (12:43 +0100)] 
ci: Clarify why we are running autogen.sh even for CMake builds

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agocmake: Add comment to configure checks explaining why we are not specifying HAVE_SOCK...
Ralf Habacker [Tue, 16 Oct 2018 11:59:04 +0000 (13:59 +0200)] 
cmake: Add comment to configure checks explaining why we are not specifying HAVE_SOCKLEN_T

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
7 years agoMove DBUS_USE_OUTPUT_DEBUG_STRING to config.h.cmake
Ralf Habacker [Tue, 16 Oct 2018 11:58:27 +0000 (13:58 +0200)] 
Move DBUS_USE_OUTPUT_DEBUG_STRING to config.h.cmake

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
7 years agotools/ci-build.sh: Add a note why we are running autogen.sh also on cmake builds
Ralf Habacker [Wed, 17 Oct 2018 12:52:49 +0000 (14:52 +0200)] 
tools/ci-build.sh: Add a note why we are running autogen.sh also on cmake builds

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
7 years agoRemove duplicated HAVE_CONFIG_H definition in cmake build system
Ralf Habacker [Mon, 15 Oct 2018 18:05:36 +0000 (20:05 +0200)] 
Remove duplicated HAVE_CONFIG_H definition in cmake build system

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
7 years agoAdd missing setup of DBUS_BUS_ENABLE_INOTIFY
Ralf Habacker [Tue, 16 Oct 2018 12:00:17 +0000 (14:00 +0200)] 
Add missing setup of DBUS_BUS_ENABLE_INOTIFY

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
7 years agoMove DBUS_ENABLE_EMBEDDED_TESTS and BUS_ENABLE_MODULAR_TESTS to config.h.cmake
Ralf Habacker [Tue, 16 Oct 2018 10:43:16 +0000 (12:43 +0200)] 
Move DBUS_ENABLE_EMBEDDED_TESTS and BUS_ENABLE_MODULAR_TESTS  to config.h.cmake

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
7 years agoKeep macro values in config.h.cmake synchronized with Autotools
Ralf Habacker [Tue, 16 Oct 2018 10:21:55 +0000 (12:21 +0200)] 
Keep macro values in config.h.cmake synchronized with Autotools

Autotools sets the value of HAVE_xxx macros in config.h to 1 if
the corresponding value exists. This has not been used consistently
in config.h.cmake so far.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
7 years agoconfigure.ac: Remove unused HAVE_V*PRINTF macros
Ralf Habacker [Tue, 16 Oct 2018 10:42:45 +0000 (12:42 +0200)] 
configure.ac: Remove unused HAVE_V*PRINTF macros

The corresponding functions are used unconditionally.

Reviewed-by: Simon McVittie <smcv@collabora.com>
7 years agoMerge branch 'desktop-sections' into 'master'
Simon McVittie [Fri, 19 Oct 2018 11:26:31 +0000 (11:26 +0000)] 
Merge branch 'desktop-sections' into 'master'

Parse desktop file section names more like the Desktop Entry specification

Closes #208

See merge request dbus/dbus!17

Reviewed-by: David King (@amigadave)
7 years agodesktop-file: Treat backslashes in section names as literal
Simon McVittie [Thu, 18 Oct 2018 16:36:37 +0000 (17:36 +0100)] 
desktop-file: Treat backslashes in section names as literal

The Desktop Entry Specification doesn't give any special meaning to
backslashes in section names: a line "[\n]" starts a section whose
name is the two characters (backslash, n), not a section whose name
is a newline. GKeyFile in GLib matches this interpretation.

In practice, the only section used by dbus-daemon is "D-BUS Service",
only way this could make a difference is if someone had written it
as "D-BUS\sService". According to
https://codesearch.debian.net/search?q=%5C%5BD-BUS%5C%5CsService%5C%5D
there is no instance of that pattern in Debian.

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agodesktop-file: Justify implementation of is_valid_section_name()
Simon McVittie [Thu, 18 Oct 2018 14:34:09 +0000 (15:34 +0100)] 
desktop-file: Justify implementation of is_valid_section_name()

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agodesktop-file test: Add to CMake build
Simon McVittie [Thu, 18 Oct 2018 13:00:06 +0000 (14:00 +0100)] 
desktop-file test: Add to CMake build

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agodesktop-file test: Expand coverage to include more corner-cases
Simon McVittie [Thu, 18 Oct 2018 12:57:13 +0000 (13:57 +0100)] 
desktop-file test: Expand coverage to include more corner-cases

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agois_valid_section_name: Fix logical expression
David King [Fri, 12 Oct 2018 12:58:43 +0000 (13:58 +0100)] 
is_valid_section_name: Fix logical expression

Group names in desktop files may contain all ASCII characters, except
control characters and '[' and ']'. Rather than accepting all values,
thanks to a logical operator confusion found by GCC warning
-Wlogical-op, instead explicitly reject the invalid values.

Signed-off-by: David King <dking@redhat.com>
Fixes: https://gitlab.freedesktop.org/dbus/dbus/issues/208
7 years agoAdd basic test coverage for the bus' desktop file parser
Simon McVittie [Thu, 18 Oct 2018 12:45:12 +0000 (13:45 +0100)] 
Add basic test coverage for the bus' desktop file parser

This doesn't cover backslash-escaping in values, or various other
corner cases, but it's a start.

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoCONTRIBUTING.md: Update and rewrite
Simon McVittie [Tue, 16 Oct 2018 14:44:59 +0000 (15:44 +0100)] 
CONTRIBUTING.md: Update and rewrite

This file hadn't kept up with reality, and needs updating for Gitlab.
Take the opportunity to rewrite it.

Much of the text, particularly about commit messages, was taken from
Wayland's contributing guide (thanks to Ander Conselvan de Oliveira,
Bryce Harrington, Eric Engestrom, Pekka Paalanen and Daniel Stone).

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoCONTRIBUTING: Reformat as Markdown
Simon McVittie [Tue, 16 Oct 2018 14:02:29 +0000 (15:02 +0100)] 
CONTRIBUTING: Reformat as Markdown

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoCONTRIBUTING: Remove all trailing whitespace
Simon McVittie [Tue, 16 Oct 2018 14:01:04 +0000 (15:01 +0100)] 
CONTRIBUTING: Remove all trailing whitespace

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoUse separate bus configuration files for executing test cases with a temporary sessio...
Ralf Habacker [Mon, 31 Oct 2011 14:53:25 +0000 (15:53 +0100)] 
Use separate bus configuration files for executing test cases with a temporary session bus

Instead of the previous adaptation of the existing template
for the session bus, a separate template is now used, which
can be more easily adapted to the requirements of the test
applications.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/57

7 years agodbus-launch: Fix unused variable warning when libX11 not present
Simon McVittie [Fri, 28 Sep 2018 14:50:43 +0000 (15:50 +0100)] 
dbus-launch: Fix unused variable warning when libX11 not present

Closes: https://gitlab.freedesktop.org/dbus/dbus/issues/228
Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agodbus-send: Avoid duplicated-branches warning
David King [Wed, 17 Oct 2018 07:33:25 +0000 (08:33 +0100)] 
dbus-send: Avoid duplicated-branches warning

Switch the order of the argument checks to avoid the
-Wduplicated-branches warning.

Signed-off-by: David King <dking@redhat.com>
Reviewed-by: Simon McVittie <smcv@collabora.com>
7 years ago_dbus_get_is_errno_eagain_or_ewouldblock: Avoid warning
David King [Fri, 12 Oct 2018 15:20:39 +0000 (16:20 +0100)] 
_dbus_get_is_errno_eagain_or_ewouldblock: Avoid warning

EAGAIN and EWOULDBLOCK are documented to possibly be numerically equal,
for instance in errno(3), and a simple logical OR check will trigger the
-Wlogical-op warning of GCC. The GCC developers consider the warning to
work as-designed in this case:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602

Avoid such a warning by explicitly checking if the values are identical.

Fixes: https://gitlab.freedesktop.org/dbus/dbus/issues/225
Signed-off-by: David King <dking@redhat.com>
Reviewed-by: Simon McVittie <smcv@collabora.com>
7 years agoBuild dbus-run-session on non Windows platforms with cmake
Ralf Habacker [Mon, 11 Dec 2017 08:14:49 +0000 (09:14 +0100)] 
Build dbus-run-session on non Windows platforms with cmake

dbus-run-session is the preferred way to run a temporary D-Bus
session scoped to the lifetime of a process, for example
dbus-run-session -- make check.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/193

7 years agocmake: Make Autotools consistency check work in out-of-srcdir builds
Simon McVittie [Tue, 4 Sep 2018 14:36:43 +0000 (07:36 -0700)] 
cmake: Make Autotools consistency check work in out-of-srcdir builds

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agocmake: Define HAVE_PRCTL, HAVE_RAISE according to existing checks
Simon McVittie [Tue, 4 Sep 2018 14:38:12 +0000 (07:38 -0700)] 
cmake: Define HAVE_PRCTL, HAVE_RAISE according to existing checks

Otherwise test-segfault will not be able to disable core dumps, making
it extremely slow and noisy to run the tests under cmake.
I added the missing checks in commit be55374f, but didn't add the
corresponding symbols to config.h.cmake.

Fixes: be55374f "cmake: check for the necessary symbols for test-segfault.c"
Closes: https://gitlab.freedesktop.org/dbus/dbus/issues/227
Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoUpdate NEWS
Simon McVittie [Fri, 5 Oct 2018 11:30:53 +0000 (12:30 +0100)] 
Update NEWS

7 years agoBelatedly add a NEWS entry for mingw-w64 printf fixes
Simon McVittie [Fri, 5 Oct 2018 11:33:05 +0000 (12:33 +0100)] 
Belatedly add a NEWS entry for mingw-w64 printf fixes

This was backported to dbus-1.12, so it needed a NEWS entry there,
at which point it seems odd for it not to have one here.

7 years agoci: Use a separate ccache for each CI job
Simon McVittie [Thu, 4 Oct 2018 17:41:29 +0000 (18:41 +0100)] 
ci: Use a separate ccache for each CI job

This should avoid them overwriting each other.

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoci: Mark many Gitlab jobs to be run manually
Simon McVittie [Thu, 4 Oct 2018 16:26:42 +0000 (17:26 +0100)] 
ci: Mark many Gitlab jobs to be run manually

freedesktop.org Gitlab doesn't currently have enough test runners
available to run all of this every time. For higher-risk changes
(for example those that change the build system) we can run the
complete set through the web UI.

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoci: Reshuffle mingw jobs so we test different combinations
Simon McVittie [Thu, 4 Oct 2018 16:04:41 +0000 (17:04 +0100)] 
ci: Reshuffle mingw jobs so we test different combinations

We test the combinations that we don't test on Travis-CI.

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoci: Use ccache to speed up repeated builds
Simon McVittie [Thu, 4 Oct 2018 09:50:37 +0000 (10:50 +0100)] 
ci: Use ccache to speed up repeated builds

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoci: Teach ci-install.sh to install wine on Debian 9 'stretch'
Simon McVittie [Wed, 3 Oct 2018 16:51:49 +0000 (17:51 +0100)] 
ci: Teach ci-install.sh to install wine on Debian 9 'stretch'

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=108177
Acked-by: Philip Withnall <withnall@endlessm.com>
7 years agoci: Explicitly install cmake
Simon McVittie [Wed, 3 Oct 2018 16:51:35 +0000 (17:51 +0100)] 
ci: Explicitly install cmake

Travis-CI workers have cmake preinstalled, but Gitlab-CI Docker images
typically don't.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=108177
Acked-by: Philip Withnall <withnall@endlessm.com>
7 years agoci: Add Gitlab-CI configuration
Simon McVittie [Wed, 3 Oct 2018 16:25:43 +0000 (17:25 +0100)] 
ci: Add Gitlab-CI configuration

This uses the same shell scripts as Travis-CI, with slightly different
settings. We use Docker containers for all our Gitlab-CI runs, so take
the opportunity to use Debian 9 'stretch' as our baseline, and
relegate Ubuntu 14.04 'trusty' to to a secondary build.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=108177
Acked-by: Philip Withnall <withnall@endlessm.com>
7 years agoUpdate NEWS
Simon McVittie [Thu, 30 Aug 2018 16:46:05 +0000 (17:46 +0100)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agobuild: Make --enable-relocation compatible with hard-coding directories
Simon McVittie [Wed, 29 Aug 2018 13:08:40 +0000 (14:08 +0100)] 
build: Make --enable-relocation compatible with hard-coding directories

Open Build Service RPMs for mingw32-dbus-1 hard-code all the
directories to make everything explicit, notably:

--prefix=/usr/i686-w64-mingw32/sys-root/mingw
--exec-prefix=/usr/i686-w64-mingw32/sys-root/mingw
...
--libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib

Previously we didn't accept this as relocatable, but actually it's
fine: ${prefix} is still equivalent to ${libdir}/pkgconfig/../..,
so our relocation setup can work. Accept the result of expanding
"${prefix}" as an acceptable value for --exec-prefix, and accept the
results of expanding "${exec_prefix}/lib" etc. as acceptable values
for --libdir.

Note the use of single vs. double quotes here. A case statement that
matches '${prefix}' tests for the literal string Â«${prefix}»,
whereas a case that matches "${prefix}" tests for the string that is
the value of the variable named Â«prefix» that is set by the
--prefix command-line argument.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107662

7 years agobuild: Give better error messages if relocation is impossible
Simon McVittie [Wed, 29 Aug 2018 13:01:02 +0000 (14:01 +0100)] 
build: Give better error messages if relocation is impossible

There are two reasons why we might reject relocation: the exec_prefix
differing from the prefix, or the libdir not being a first-level
subdirectory named "lib" or "lib64" of the prefix. Make it clearer
which one failed and why.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107662

7 years agoUpdate NEWS
Simon McVittie [Thu, 30 Aug 2018 16:39:09 +0000 (17:39 +0100)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agocontainers: Share code for what happens when we lose a connection
Simon McVittie [Tue, 3 Jul 2018 19:26:33 +0000 (20:26 +0100)] 
containers: Share code for what happens when we lose a connection

This improves test coverage, because
bus_container_instance_lost_connection() was previously only called
when we failed to set up a connection with a server due to OOM, but
it is now also called (instead of being duplicated) when we are told
to clean up a connection because it has disconnected.

To make sure that connections from containers can never cheat their
way into being treated as uncontained, do not set their
contained_data_slot to NULL.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107739

7 years agoAdd more test coverage for config file parsing
Simon McVittie [Fri, 17 Aug 2018 16:02:45 +0000 (17:02 +0100)] 
Add more test coverage for config file parsing

minimal.conf is a valid config file added to make it obvious why
the new invalid config files are invalid.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107739

7 years agobus_config_parser_check_doctype: Remove, unused
Simon McVittie [Wed, 29 Aug 2018 17:33:01 +0000 (18:33 +0100)] 
bus_config_parser_check_doctype: Remove, unused

We have never checked the <!DOCTYPE> of busconfig XML since the libxml
parser was removed in 2013, and the libxml parser was broken before
that anyway. The recommended Expat parser (our only parser since 2013)
does not appear to have ever validated this, so now does not seem like
the time to start. Just ignore the <!DOCTYPE> if there is one.

(We never validated this particularly strictly anyway;
<!DOCTYPE busconfig SYSTEM "http://example.com/bees"> would have been
treated as perfectly valid.)

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107739

7 years agocontainers test: Exercise GetConnectionInstance() on dbus-daemon itself
Simon McVittie [Fri, 3 Aug 2018 14:33:08 +0000 (15:33 +0100)] 
containers test: Exercise GetConnectionInstance() on dbus-daemon itself

This is an easy bit of missing test coverage detected by running the
test suite with gcov.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107739

7 years agoBusConfigParser test: Check that all limits are equal, not just one
Simon McVittie [Fri, 17 Aug 2018 15:35:37 +0000 (16:35 +0100)] 
BusConfigParser test: Check that all limits are equal, not just one

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107739

7 years agobus_context_get_policy: Remove, unused
Simon McVittie [Fri, 17 Aug 2018 15:33:06 +0000 (16:33 +0100)] 
bus_context_get_policy: Remove, unused

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107739

7 years agobus_connections_get_context: Remove, unused
Simon McVittie [Fri, 17 Aug 2018 15:31:00 +0000 (16:31 +0100)] 
bus_connections_get_context: Remove, unused

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107739

7 years agobus_connections_foreach, bus_connections_foreach_active: Remove
Simon McVittie [Fri, 17 Aug 2018 15:30:23 +0000 (16:30 +0100)] 
bus_connections_foreach, bus_connections_foreach_active: Remove

These do not appear in code coverage statistics, and `git grep`
reveals that they are unused.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107739

7 years agodbus-cleanup-sockets: Mark functions noreturn as suggested by clang
Simon McVittie [Fri, 3 Aug 2018 14:21:53 +0000 (15:21 +0100)] 
dbus-cleanup-sockets: Mark functions noreturn as suggested by clang

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107739

7 years agoUpdate NEWS
Simon McVittie [Thu, 30 Aug 2018 16:33:16 +0000 (17:33 +0100)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoDo not apply __attribute__((__malloc__)) to dbus_realloc()
Simon McVittie [Thu, 23 Aug 2018 08:01:03 +0000 (09:01 +0100)] 
Do not apply __attribute__((__malloc__)) to dbus_realloc()

As noted in GLib commit c879f50f, gcc's interpretation of the malloc
attribute has become more strict over time, which could result in
miscompilation. The new definition is that in addition to assuming
that the returned memory block is newly-allocated, gcc now assumes
that it does not contain any valid pointers. This is OK for
uninitialized or zero-initialized memory returned by dbus_malloc()
or dbus_malloc0(), but not valid for dbus_realloc(), which might be
used for a dynamically-sized array of (structures containing)
valid pointers.

See https://gitlab.gnome.org/GNOME/glib/issues/1465

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107741

7 years agoDistribute source code using .tar.xz archives
Francesco Turco [Wed, 22 Aug 2018 11:43:21 +0000 (11:43 +0000)] 
Distribute source code using .tar.xz archives

This saves around 32% of the size of the archive.

[smcv: Rebased onto current master]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107630

7 years agobuild: Don't install a ChangeLog that we don't update
Simon McVittie [Thu, 23 Aug 2018 18:14:14 +0000 (19:14 +0100)] 
build: Don't install a ChangeLog that we don't update

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107630

7 years agoRemove old changelogs from git
Simon McVittie [Thu, 23 Aug 2018 18:13:35 +0000 (19:13 +0100)] 
Remove old changelogs from git

The changelogs (and the commits themselves, converted to git format)
are still in the git history if anyone needs them.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
https://bugs.freedesktop.org/show_bug.cgi?id=107630

7 years agobuild: Don't ship detailed changelogs for releases over 10 years old
Simon McVittie [Thu, 23 Aug 2018 18:12:49 +0000 (19:12 +0100)] 
build: Don't ship detailed changelogs for releases over 10 years old

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107630

7 years agoserver-unix: Don't leak address of systemd server on success
Simon McVittie [Tue, 24 Jul 2018 12:21:37 +0000 (13:21 +0100)] 
server-unix: Don't leak address of systemd server on success

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107320
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
7 years agobus: Free address (from --address) when we have finished using it
Simon McVittie [Tue, 24 Jul 2018 12:18:48 +0000 (13:18 +0100)] 
bus: Free address (from --address) when we have finished using it

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107320
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
7 years agoCONTRIBUTING: Reference the freedesktop.org Code of Conduct
Simon McVittie [Wed, 22 Aug 2018 16:50:18 +0000 (17:50 +0100)] 
CONTRIBUTING: Reference the freedesktop.org Code of Conduct

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoRename HACKING to CONTRIBUTING
Simon McVittie [Wed, 22 Aug 2018 16:48:34 +0000 (17:48 +0100)] 
Rename HACKING to CONTRIBUTING

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years ago1.13.7
Simon McVittie [Fri, 3 Aug 2018 00:01:11 +0000 (01:01 +0100)] 
1.13.7

7 years ago1.13.6 dbus-1.13.6
Simon McVittie [Thu, 2 Aug 2018 18:32:55 +0000 (19:32 +0100)] 
1.13.6

7 years agoUpdate NEWS
Simon McVittie [Thu, 2 Aug 2018 18:23:52 +0000 (19:23 +0100)] 
Update NEWS

7 years agovalidate_body_helper: Bounds-check before validating booleans
Simon McVittie [Thu, 12 Jul 2018 18:11:05 +0000 (19:11 +0100)] 
validate_body_helper: Bounds-check before validating booleans

Running the "embedded tests" through valgrind revealed that before this
commit, we would have been willing to read up to 3 bytes off the end of
a message if the message is truncated part way through a boolean. Any
practical allocator will round up allocations to the next 32-bit (or
larger) boundary, so in practice this will not leave the memory buffer
(and in particular did not crash during unit testing), but it could read
uninitialized contents.

On little-endian CPUs, an attacker might be able to use this to learn
whether up to 3 bytes of uninitialized memory in the dbus-daemon
were all-zero (their crafted message would be relayed) or not (their
connection would be disconnected for sending an invalid message). On
big-endian CPUs, an attacker might be able to use this to learn whether
up to 3 bytes were all-zeroes (relayed to a cooperating peer), 0-2
bytes of all-zeroes followed by 0x01 (relayed to a cooperating peer),
or something else (disconnected). This is not believed to be exploitable
to leak interesting information.

Fixes: 62e46533 "hardcode dbus_bool_t to 32 bits"
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107332
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
7 years agoUpdate NEWS
Simon McVittie [Thu, 2 Aug 2018 17:50:36 +0000 (18:50 +0100)] 
Update NEWS

7 years agoDon't do OOM testing under valgrind by default
Simon McVittie [Thu, 12 Jul 2018 14:28:54 +0000 (15:28 +0100)] 
Don't do OOM testing under valgrind by default

It's just painfully slow, particularly when we fork (as we do in
test-bus to test service activation).

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

7 years agodispatch test: Simplify OOM testing
Simon McVittie [Thu, 12 Jul 2018 14:16:55 +0000 (15:16 +0100)] 
dispatch test: Simplify OOM testing

Instead of having separate test wrappers for the cases that do and
don't take a DBusConnection, we can just pass a NULL DBusConnection
to the one that doesn't.

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

7 years agoSkip name-test/ when running under valgrind for now
Simon McVittie [Thu, 12 Jul 2018 12:06:32 +0000 (13:06 +0100)] 
Skip name-test/ when running under valgrind for now

These tests are very reliant on their custom LOG_COMPILER,
which AX_VALGRIND_CHECK replaces.

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

7 years agotests: Detach most connections from main loop before closing
Simon McVittie [Thu, 12 Jul 2018 11:51:38 +0000 (12:51 +0100)] 
tests: Detach most connections from main loop before closing

We don't need to do this for connections that were never set up
with the main loop.

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

7 years agotest/containers: Fix some memory leaks
Simon McVittie [Thu, 12 Jul 2018 13:23:06 +0000 (14:23 +0100)] 
test/containers: Fix some memory leaks

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

7 years agotest/marshal: Don't leak a message and its marshalled buffer
Simon McVittie [Thu, 12 Jul 2018 12:32:34 +0000 (13:32 +0100)] 
test/marshal: Don't leak a message and its marshalled buffer

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

7 years agononce: Don't try to rmdir(NULL) on OOM
Simon McVittie [Thu, 12 Jul 2018 12:32:10 +0000 (13:32 +0100)] 
nonce: Don't try to rmdir(NULL) on OOM

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

7 years agotest/dbus-daemon: Don't leak expected error for max connections
Simon McVittie [Wed, 11 Jul 2018 18:55:31 +0000 (19:55 +0100)] 
test/dbus-daemon: Don't leak expected error for max connections

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

7 years agotest/dbus-daemon: Don't leak error if no machine ID was found
Simon McVittie [Wed, 11 Jul 2018 18:54:24 +0000 (19:54 +0100)] 
test/dbus-daemon: Don't leak error if no machine ID was found

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

7 years agoAllow longer for tests under valgrind
Simon McVittie [Wed, 11 Jul 2018 18:47:34 +0000 (19:47 +0100)] 
Allow longer for tests 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

7 years agotests: Call dbus_shutdown()
Simon McVittie [Wed, 11 Jul 2018 15:40:12 +0000 (16:40 +0100)] 
tests: Call dbus_shutdown()

Not all of these tests will be fully valgrind-clean yet (or perhaps
ever), but it's easier to add this to all of them than to think
about it.

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

7 years agotests: Interpret empty command-line arguments as --tap
Simon McVittie [Wed, 11 Jul 2018 15:31:38 +0000 (16:31 +0100)] 
tests: Interpret empty command-line arguments as --tap

AX_VALGRIND_CHECK overrides LOG_COMPILER, which means we can't rely
on running under glib-tap-test.sh. Default to TAP mode by modifying
our (effective) argv instead.

If you really want the default behaviour (unstructured output) this
can still be achieved by adding some arguments that are a no-op,
such as `-m quick`.

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

7 years agotests: Detach server from main loop during teardown
Simon McVittie [Wed, 11 Jul 2018 15:22:49 +0000 (16:22 +0100)] 
tests: Detach server from main loop during teardown

test_server_setup() takes a reference to the DBusServer, so we need
to release that ref by calling test_server_shutdown().
test_server_shutdown() also disconnects the server, so we don't need
to do that.

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

7 years agodbus_server_listen: Don't leak first_connect_error
Simon McVittie [Wed, 11 Jul 2018 15:16:38 +0000 (16:16 +0100)] 
dbus_server_listen: Don't leak first_connect_error

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

7 years agoloopback: Don't free credentials borrowed from the connection
Simon McVittie [Wed, 11 Jul 2018 15:15:38 +0000 (16:15 +0100)] 
loopback: Don't free credentials borrowed from the connection

We currently get away with this because the connection isn't fully
freed before we exit, but the connection is meant to own the result
of _dbus_connection_get_credentials() (it's "(transfer none)" in
GLib terminology).

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

7 years agodbus_server_listen: Assert that implementations return a known result
Simon McVittie [Wed, 11 Jul 2018 15:14:27 +0000 (16:14 +0100)] 
dbus_server_listen: Assert that implementations return a known result

If they didn't, we'd probably leak the server and/or the error.

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

7 years agoAssert that DBUS_SERVER_LISTEN_ADDRESS_ALREADY_USED does not set error
Simon McVittie [Mon, 9 Jul 2018 16:06:22 +0000 (17:06 +0100)] 
Assert that DBUS_SERVER_LISTEN_ADDRESS_ALREADY_USED does not set error

The only place this is set in practice is in dbus-server-win.c, which
does not set the error. If it did, dbus_server_listen() would leak it.

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

7 years agoUpdate NEWS
Simon McVittie [Thu, 2 Aug 2018 14:29:46 +0000 (15:29 +0100)] 
Update NEWS

7 years agosysdeps: Reassure gcc 8 that we are not overflowing struct sockaddr_un
Simon McVittie [Mon, 23 Jul 2018 17:52:01 +0000 (18:52 +0100)] 
sysdeps: Reassure gcc 8 that we are not overflowing struct sockaddr_un

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>
7 years agotest: Avoid g_queue_foreach
Simon McVittie [Mon, 23 Jul 2018 17:02:42 +0000 (18:02 +0100)] 
test: Avoid g_queue_foreach

In gcc 8, -Wall -Wextra includes -Wcast-function-type, which warns
about passing an extra (unwanted) parameter to callbacks. Instead
of using g_list_foreach(), open-code the equivalent.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107349
Reviewed-by: Thiago Macieira <thiago@kde.org>
7 years agodbus_connection_dispatch: Avoid using _dbus_list_foreach
Simon McVittie [Mon, 23 Jul 2018 17:02:16 +0000 (18:02 +0100)] 
dbus_connection_dispatch: Avoid using _dbus_list_foreach

In gcc 8, -Wall -Wextra includes -Wcast-function-type, which warns
about passing an extra (unwanted) parameter to callbacks. Instead
of using _dbus_list_foreach(), open-code the equivalent here.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107349
Reviewed-by: Thiago Macieira <thiago@kde.org>
7 years agoAdd and use _dbus_list_clear_full
Simon McVittie [Mon, 23 Jul 2018 16:33:24 +0000 (17:33 +0100)] 
Add and use _dbus_list_clear_full

In gcc 8, -Wall -Wextra includes -Wcast-function-type, which warns
about passing an extra (unwanted) parameter to callbacks. Instead
of using _dbus_list_foreach(), add a function to do what we actually
wanted here.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107349
Reviewed-by: Thiago Macieira <thiago@kde.org>
7 years agoRename dbus_internal_do_not_use_get_uuid to _dbus_get_uuid
Simon McVittie [Mon, 23 Jul 2018 16:32:27 +0000 (17:32 +0100)] 
Rename dbus_internal_do_not_use_get_uuid to _dbus_get_uuid

This was the only remaining symbol using the long prefix. Renaming it
gives us one consistent rule: symbols starting with dbus are public,
symbols starting with _dbus are not.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107349
Reviewed-by: Thiago Macieira <thiago@kde.org>
7 years agotest: Don't use dbus_internal prefix for functions not in libdbus
Simon McVittie [Mon, 23 Jul 2018 16:29:56 +0000 (17:29 +0100)] 
test: Don't use dbus_internal prefix for functions not in libdbus

As in the previous commit, this prefix is meaningless in translation
units that don't get compiled into libdbus.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107349
Reviewed-by: Thiago Macieira <thiago@kde.org>
7 years agomessage-util: Make more functions static (and remove useless prefix)
Simon McVittie [Mon, 23 Jul 2018 16:26:18 +0000 (17:26 +0100)] 
message-util: Make more functions static (and remove useless prefix)

The naming convention dbus_internal_do_not_use_foo() was for functions
that had to be exported by libdbus but called by the embedded tests.
This is obsolete (in favour of _dbus_foo()) now that we have
DBUS_PRIVATE_EXPORT, and is doubly useless in this case because these
functions aren't even in libdbus - they're local to dbus-message-util.c.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107349
Reviewed-by: Philip Withnall <withnall@endlessm.com>
7 years agotest: Fix signature of dbus_internal_do_not_use_try_message_file
Simon McVittie [Mon, 23 Jul 2018 16:19:53 +0000 (17:19 +0100)] 
test: Fix signature of dbus_internal_do_not_use_try_message_file

In gcc 8, -Wall -Wextra includes -Wcast-function-type, which warns
about casting a function pointer to an incompatible type. In this
case the cast was because we were ignoring the void * argument, which
in this case is NULL. Since this function is only used within
dbus-message-util.c anyway, we might as well just use the correct
signature and remove the cast.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107349
Reviewed-by: Thiago Macieira <thiago@kde.org>
7 years agocontainers test: Record the unconfined manager connection's unique name
Simon McVittie [Fri, 11 May 2018 17:40:51 +0000 (18:40 +0100)] 
containers test: Record the unconfined manager connection's unique name

This is a bit more convenient than fetching it as-needed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105656

7 years agocontainers test: Factor out fixture_disconnect_observer
Simon McVittie [Fri, 11 May 2018 17:38:07 +0000 (18:38 +0100)] 
containers test: Factor out fixture_disconnect_observer

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105656

7 years agocontainers test: Factor out disconnecting the unconfined manager
Simon McVittie [Fri, 11 May 2018 17:36:47 +0000 (18:36 +0100)] 
containers test: Factor out disconnecting the unconfined manager

As this test's coverage expands, this function will have to do more
(clear up name watches, filters, etc.) so it'll be helpful to keep it
all in one place.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105656

7 years agocontainers test: Move teardown below all test-cases
Simon McVittie [Thu, 31 May 2018 18:36:45 +0000 (19:36 +0100)] 
containers test: Move teardown below all test-cases

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105656

7 years agocontainers: Factor out connection_get_instance and make it NULL-safe
Simon McVittie [Mon, 16 Apr 2018 18:35:59 +0000 (19:35 +0100)] 
containers: Factor out connection_get_instance and make it NULL-safe

When I introduce per-container message filtering, it'll be useful to
be able to get the instance for a connection without worrying about
whether that connection is NULL (representing the dbus-daemon itself,
or an activatable service that has not yet been activated).

Also make it robust against Containers having not been initialized,
for completeness.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105656

7 years agobus: Document arguments of bus_activation_activate_service
Simon McVittie [Wed, 18 Apr 2018 10:49:07 +0000 (11:49 +0100)] 
bus: Document arguments of bus_activation_activate_service

It isn't completely obvious that connection is allowed to be NULL here.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105656

7 years agobus_service_list_queued_owners: Don't return a DBusError
Simon McVittie [Tue, 17 Apr 2018 11:48:23 +0000 (12:48 +0100)] 
bus_service_list_queued_owners: Don't return a DBusError

This makes it clearer that the only possible error is out-of-memory,
so its use in ListQueuedOwners() is not leaking information to callers
that might not be allowed to know the difference between "doesn't exist"
and "exists but you are not allowed to know that".

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105656