Simon McVittie [Tue, 21 Nov 2017 14:36:02 +0000 (14:36 +0000)]
_dbus_server_new_for_socket: Invalidate watches during error unwinding
We assert that every watch is invalidated before it is freed, but
in some OOM code paths this didn't happen.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104
(cherry picked from commit
1ce34beef85a7a0b3c25890837e3a72f8bdac1f0)
Simon McVittie [Tue, 14 Nov 2017 12:25:58 +0000 (12:25 +0000)]
Update NEWS for 1.12.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
Thomas Zajic [Tue, 14 Nov 2017 12:23:51 +0000 (12:23 +0000)]
Add a missing space in logging output
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103729
(cherry picked from commit
c9ce0a705966c78c680b465fb5747a16c570c4a8)
Simon McVittie [Mon, 13 Nov 2017 17:11:27 +0000 (17:11 +0000)]
Start 1.12.4
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 13 Nov 2017 13:35:55 +0000 (13:35 +0000)]
1.12.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 10 Nov 2017 16:24:59 +0000 (16:24 +0000)]
Update NEWS for 1.12.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 6 Nov 2017 16:16:31 +0000 (16:16 +0000)]
bus_connections_setup_connection: If we can't set it up, log why
While reviewing fd.o#101354, Philip Withnall pointed out that if we
rejected a connection in the new code there, we didn't log why. It
turns out we didn't log that in the more normal code path either.
Redo the error handling so that failure to set up a connection
is logged.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103592
(cherry picked from commit
56847ae818e8c144b9c7a8102efd1c926ead2f62)
Simon McVittie [Fri, 10 Nov 2017 16:20:02 +0000 (16:20 +0000)]
Update NEWS for 1.12.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Tue, 25 Jul 2017 11:43:01 +0000 (12:43 +0100)]
travis-ci: Enable/disable more features in various builds
In the debug build, enable features that are off by default. In the
reduced build, explicitly disable features, some of which are
on by default. In the legacy build, check that we can compile the
default feature-set without inotify, dnotify, systemd, etc.
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
3c031ef5aa1f7f53c6344781cb38b78abe44dc96)
Simon McVittie [Mon, 6 Nov 2017 19:11:32 +0000 (19:11 +0000)]
_dbus_accept_with_noncefile: Don't leak nonce
This was always leaked, both on success and on 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=103597
(cherry picked from commit
37d5af203c0fc22c9ae746b2ae4781ff648a792f)
Simon McVittie [Mon, 6 Nov 2017 19:10:42 +0000 (19:10 +0000)]
do_noncefile_create: Avoid freeing uninitialized memory on error
We could free all of these without having ever successfully
initialized them.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103597
(cherry picked from commit
6d08f5c04e601f16ef4ee2126a90c924b7e26df0)
Simon McVittie [Mon, 6 Nov 2017 19:09:51 +0000 (19:09 +0000)]
do_check_nonce: Don't free uninitialized memory on OOM
If _dbus_string_init() fails, it doesn't guarantee that the string
is initialized to anything in particular. Worse, if
_dbus_string_init (&buffer) fails, p would never have been initialized
at all, due to the use of the short-circuiting || operator.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103597
(cherry picked from commit
0ea0e4b0fddd1109835b8b9f7a8319d59c8d9303)
Simon McVittie [Tue, 31 Oct 2017 13:06:48 +0000 (13:06 +0000)]
Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Tony Theodore [Tue, 31 Oct 2017 13:02:37 +0000 (13:02 +0000)]
build: Avoid using `echo -e`
`echo -e` is a GNU extension, and in particular not available on
Darwin.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103493
[smcv: Added commit message]
Reviewed-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
216ae1adfcf9ce9274019b3c29b8f1245c26dec1)
Simon McVittie [Tue, 31 Oct 2017 11:40:29 +0000 (11:40 +0000)]
Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
ilovezfs [Tue, 31 Oct 2017 11:36:05 +0000 (11:36 +0000)]
build: Use $(MKDIR_P) syntax suitable for install-sh
This fixes the build when a GNU-compatible `mkdir -p` is not available.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103521
[smcv: Add commit message]
Reviewed-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
c7d8b723eb53848f9a86f36d640ea5f564d34590)
Simon McVittie [Mon, 30 Oct 2017 14:49:59 +0000 (14:49 +0000)]
Bump version for 1.12.x branch
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 30 Oct 2017 12:37:23 +0000 (12:37 +0000)]
Prepare 1.12.0
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 30 Oct 2017 12:31:03 +0000 (12:31 +0000)]
Disable deprecation warnings for stable branch
We're not going to replace deprecated functions here, similar to commit
88e0ccb2 in the dbus-1.10 branch.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 23 Oct 2017 15:10:39 +0000 (16:10 +0100)]
NEWS for #103420
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 23 Oct 2017 14:07:24 +0000 (15:07 +0100)]
build: Remove various unused files from build system
These were in git but not distributed in source tarballs, and in fact
not hooked up to the Autotools build system at all.
test/data/valid-introspection-files was mentioned in the CMake build
system (copied from the source directory to the build directory), but
according to `git grep` is not used for anything.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
Simon McVittie [Mon, 23 Oct 2017 12:59:34 +0000 (13:59 +0100)]
build: Include README.cmake in Autotools "make dist"
Our official source releases are Autotools "make dist" tarballs, but
there's no reason why CMake users can't use those too, and we already
include the CMake build files.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
Simon McVittie [Mon, 23 Oct 2017 12:57:56 +0000 (13:57 +0100)]
build: Distribute individual files and directories from cmake/
If we distribute the entire directory in "make dist" tarballs, then
we include the generated files cmake/DBus1Config.cmake and
cmake/DBus1ConfigVersion.cmake, which we should not.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
Simon McVittie [Mon, 23 Oct 2017 12:32:22 +0000 (13:32 +0100)]
build: Distribute more test data in source tarballs
test-bus exercises the parser by trying to parse every file in these
directories. A couple of files were accidentally left out, meaning
those parsing code paths are tested when we build from git, but not
when we build from a tarball release.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
Simon McVittie [Mon, 23 Oct 2017 13:41:24 +0000 (14:41 +0100)]
build: Don't explicitly clean up configure-generated files
cmake/DBus1Config.cmake, cmake/DBus1ConfigVersion.cmake and dbus-1.pc
are all generated by AC_CONFIG_FILES, so they are automatically listed
in $(CONFIG_CLEAN_FILES) and cleaned in "make distclean" without further
help from us.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
Simon McVittie [Mon, 23 Oct 2017 12:18:55 +0000 (13:18 +0100)]
build: Don't distribute versioninfo.rc in "make dist" tarballs
It's generated by configure, so we should not distribute it.
Because it's generated by configure, it is automatically cleaned up
by "make distclean" via $(CONFIG_CLEAN_FILES).
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
Simon McVittie [Mon, 23 Oct 2017 14:21:58 +0000 (15:21 +0100)]
Start towards 1.11.24 (or maybe 1.12.0)
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 23 Oct 2017 10:29:57 +0000 (11:29 +0100)]
Prepare 1.11.22
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 23 Oct 2017 10:09:45 +0000 (11:09 +0100)]
Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Wed, 18 Oct 2017 06:23:06 +0000 (08:23 +0200)]
Do not add custom UAC related manifest to cmake builds for MSVC on Windows
MSVC compiler >= 8.0 (VS 2005) add an identical manifest (with uac level
set to 'asInvoker' specified by /MANIFEST) by default to generated binaries
(see https://msdn.microsoft.com/en-us/library/f2c0w594.aspx for details).
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102558
Simon McVittie [Thu, 19 Oct 2017 16:57:53 +0000 (17:57 +0100)]
Add first draft of release notes for 1.12.0
I'm hoping for 1.11.24 to act as 1.12rc1, with a remarkably similar
1.12.0 release shortly after if all goes well.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Thu, 19 Oct 2017 16:56:55 +0000 (17:56 +0100)]
Update NEWS for latest versioninfo changes
Signed-off-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Tue, 17 Oct 2017 15:14:43 +0000 (17:14 +0200)]
Fix cmake 3.5 configure error on opening a non existant file
Previous cmake versions seemed to be more tolerant.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Fri, 6 Oct 2017 20:46:13 +0000 (22:46 +0200)]
Update versioninfo.rc.in
- include <windows.h> to be able to use constants
- let versioninfo be visible in explorer by adding a "Translation" value
- change FILEOS from VOS_NT_WINDOWS32, which was intended for Windows NT,
to VOS__WINDOWS32
- stop setting FILEFLAGS 0x20 (VS_FF_SPECIALBUILD), which is not
appropriate here because we build the normal version, not a special
version
- use constants
- fix strings
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Wed, 18 Oct 2017 13:48:51 +0000 (14:48 +0100)]
Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Tue, 17 Oct 2017 18:56:12 +0000 (20:56 +0200)]
Add version info to dbus-1 target for non msvc builds on Windows too
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Reviewed-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Tue, 17 Oct 2017 18:57:50 +0000 (20:57 +0200)]
Use cmake build in timestamp function to generate the build time stamp
The recent implementation generates a timestamp containing eol on
linux hosts, which generates unparseable versioninfo.rc.
This commit raises the minimal required cmake version to 3.0.2.
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Reviewed-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Thu, 28 Sep 2017 16:07:20 +0000 (17:07 +0100)]
Windows: Check for $RC, not $WINDRES
That's what is checked for by LT_LANG([Windows Resource]) further
up, and is what we now use during the build. Its value is typically
i686-w64-mingw32-windres.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Simon McVittie [Thu, 28 Sep 2017 16:00:29 +0000 (17:00 +0100)]
Windows: Use libtool-detected RC to compile resources in tools/
We have two variables that both expand to i686-w64-mingw32-windres,
namely WINDRES and RC, and we might as well use the same one as
in dbus/ here. However, it seems we can't wrap windres in libtool
when producing an executable: if we use .rc.lo, my Automake 1.15.1
doesn't realise that it needs to include disable-uac.lo in the
list of objects, whereas if we use .rc.o, Ralf's libtool 2.4.2 and
Automake 1.13.4 disagree on where the output should go
(.libs/disable-uac.o vs. disable-uac.o) and the link fails.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Simon McVittie [Fri, 6 Oct 2017 12:00:39 +0000 (13:00 +0100)]
Windows: Stop manipulating line numbering in versioninfo.rc
If __LINE__ doesn't work in MSVC's resource compiler, then removing
the #line directive altogether seems a simpler fix than redefining
__LINE__ to the wrong value.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Simon McVittie [Fri, 6 Oct 2017 11:54:30 +0000 (12:54 +0100)]
cmake: Stop creating an empty afxres.h
The resource file used to #include this, but it was unnecessary,
and Ralf removed it in commit e3a14eb.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Simon McVittie [Thu, 28 Sep 2017 15:58:34 +0000 (16:58 +0100)]
Windows: Simplify compiling versioninfo.rc by using libtool facilities
libtool has built-in support for Windows resources, and we even
enable it in configure.ac. What it doesn't have is a built-in rule
for generating Libtool objects using that built-in support, but
we can add one.
We have to generate Libtool pseudo-objects (.lo) rather than native
object files (.o) so that we get both a PIC object for the shared
library and a non-PIC object for the static library.
This mimics the libtool invocations used for compiling C and C++.
Note that $(RC) is typically i686-w64-mingw32-windres, the same as
our project-specific variable $(WINDRES) which was previously used here.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
David King [Tue, 3 Oct 2017 12:34:03 +0000 (13:34 +0100)]
doc: Fix dbus-send.1 uint16 typo
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103075
Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1467415
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Tue, 3 Oct 2017 09:46:19 +0000 (10:46 +0100)]
Post-release version bump (and add release name)
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Tue, 3 Oct 2017 06:46:29 +0000 (07:46 +0100)]
Prepare 1.11.20
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Tue, 3 Oct 2017 06:45:39 +0000 (07:45 +0100)]
Clarify NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 29 Sep 2017 13:12:41 +0000 (14:12 +0100)]
Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 29 Sep 2017 11:27:11 +0000 (12:27 +0100)]
unix: Condition Linux-specific abstract sockets on __linux__
This is nicer for cross-compiling, because AC_RUN_IFELSE can't work
there. In practice abstract sockets are supported on Linux since
2.2 (so, all relevant versions), and on no other platform; so it
seems futile to keep this complexity.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34905
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Fri, 29 Sep 2017 11:18:25 +0000 (12:18 +0100)]
build: Remove unused substitution DBUS_PATH_OR_ABSTRACT
This was presumably once used in constructs like
"unix:" DBUS_PATH_OR_ABSTRACT "=/var/run/dbus/foo", but git grep says
there are no remaining uses, so it can go.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34905
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Thu, 28 Sep 2017 12:27:08 +0000 (13:27 +0100)]
build: Remove unused variables
libdbus isn't localized, so we have no use for libintl. We always
link libdbus-1 with -no-undefined, so we have no use for
putting that flag in no_undefined on Windows only. export_symbols
seems to be left over from before fd.o#83115 was fixed.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Thu, 28 Sep 2017 12:19:43 +0000 (13:19 +0100)]
dbus: Actually link versioninfo.o into libdbus
It appears this has been wrong ever since the versioninfo machinery
was first added in 2009, and nobody noticed until now.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Thu, 28 Sep 2017 12:18:11 +0000 (13:18 +0100)]
dbus: Clarify why we are not just adding the resource file to SOURCES
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Thu, 28 Sep 2017 12:17:36 +0000 (13:17 +0100)]
dbus: Make SUFFIXES more specific
We want this to apply to files ending with ".rc", but not to files
ending with just "rc", like .arc or something.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Wed, 27 Sep 2017 17:39:23 +0000 (18:39 +0100)]
ci-build: Use a mirror of mingw binaries, not msys2 binaries
Signed-off-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Tue, 26 Sep 2017 10:06:10 +0000 (12:06 +0200)]
Add Windows manifest to dbus-update-activation-environment.exe
This explicitly sets the execution level to 'asInvoker', preventing
Windows' UAC heuristics from deciding that because its name mentions
"update", it probably needs to escalate privileges.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102558
Reviewed-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Wed, 27 Sep 2017 14:38:20 +0000 (15:38 +0100)]
ci-build: Use a mirror that hopefully works better than Sourceforge
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Wed, 27 Sep 2017 12:59:43 +0000 (13:59 +0100)]
sysdeps: Stop pretending _dbus_set_signal_handler is portable to Windows
None of the things we rely on in POSIX async signal handlers, such
as the existence of async-signal-safe write(), are portable to Windows,
so the async signal handlers that use this function are #ifdef
DBUS_UNIX anyway. Remove the unused stub function from the
Windows side, and move the declaration to the Unix-specific header.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103010
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Wed, 27 Sep 2017 12:56:34 +0000 (13:56 +0100)]
Make sure non-aborting signal handlers save and restore errno
If an async signal interrupts some function, we can have this
anti-pattern:
/* in normal code */
result = some_syscall (); /* fails, e.g. errno = EINVAL */
/* interrupted by async signal handler */
write (...); /* fails, e.g. errno = ENOBUFS */
/* back to normal code */
if (errno == EINVAL) /* problem! it should be but it isn't */
The solution is for signal handlers to save and restore errno.
This is unnecessary for signal handlers that can't touch errno (like
the one in dbus-launch that just sets a flag), and for signal handlers
that never return (like the one in test-utils-glib for timeouts).
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103010
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Wed, 27 Sep 2017 12:14:39 +0000 (13:14 +0100)]
tests: In slower tests, make the timeout per-test-case
Some test-cases in the dbus-daemon and relay tests spam the bus with
thousands of messages, which can take 25 seconds on slower CPUs like
MIPS. Similarly, the refs test spams millions of refcount operations,
which it appears might take more than a minute on PA-RISC (HPPA).
To get an idea of how close we are to having a problem on other
architectures, log a message and start a timer when we reset the
timeout in setup(), and log the elapsed time when we reach teardown().
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103009
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Wed, 27 Sep 2017 12:14:36 +0000 (13:14 +0100)]
test-utils-glib: Try to emit TAP diagnostics before aborting
We can't use normal I/O in a signal handler, so resort to write().
"Bail out!" is a special syntactic token in TAP. If I artifically force
the tests to time out by reducing timeouts and increasing the number of
operations, I get results like this:
ERROR: test-sd-activation - Bail out! Test timed out (GLib main loop timeout callback reached)
ERROR: test-refs - Bail out! Test timed out (SIGALRM received)
which is a lot easier to understand than "Not enough tests run" or
"nonzero exit status". The differing output is because test-sd-activation
iterates the main loop, whereas test-refs just blocks (it is joining a
series of worker threads, each of which is spamming refcount operations).
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103009
Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Use STDOUT_FILENO as per Philip's review]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 25 Sep 2017 23:34:39 +0000 (00:34 +0100)]
Post-release version bump
Simon McVittie [Mon, 25 Sep 2017 19:58:54 +0000 (20:58 +0100)]
Prepare 1.11.18 release
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 25 Sep 2017 13:50:16 +0000 (14:50 +0100)]
Remove distribution-specific init-scripts
LSB-style (SysV-style) init scripts have not historically been
portable between distributions, as evidenced by the presence of both
"Red Hat" and "Slackware" init scripts in dbus. Many distributors
prefer to maintain them downstream, as is done in Debian (and its
derivatives) and in Slackware, so that the init script can follow
OS conventions (for example regarding boot messages) and make use
of OS-provided facilities (for example, the Debian init script uses
dpkg's start-stop-daemon utility).
The Slackware and Red Hat init scripts removed by this commit are not
tested or maintained in practice, and so are likely to have bugs. The
Slackware init-script provided here is not used on actual Slackware
systems, which provide a different implementation of rc.messagebus in
their packaging, while the Red Hat init script has been superseded by
the systemd unit in current Fedora, CentOS and RHEL versions.
The Cgywin messagebus-config provided here does appear to be used in
production in cygwin-ports, but it's full of Cygwin-specifics with which
the dbus maintainers are not familiar, so it is probably more appropriate
for it to be tracked downstream as part of the Cygwin packaging.
The systemd unit is not removed, since it is used on multiple Linux
distributions with little or no modification, and receives regular
testing and maintenance; this makes it appropriate to maintain upstream.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/101706
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Mon, 25 Sep 2017 13:09:35 +0000 (14:09 +0100)]
Deprecate the pam_console/pam_foreground flag-file directory
This feature is now compile-time conditional, and off by default.
pam_console appears to have been in Fedora and Gentoo until 2007.
pam_foreground seems to be specific to Debian and Ubuntu, where it was
unmaintained since 2008 and removed in 2010. The replacement for both
was ConsoleKit, which has itself been superseded by systemd-logind and
ConsoleKit2.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/101629
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Mon, 25 Sep 2017 16:02:50 +0000 (17:02 +0100)]
Merge branch 'dbus-1.10'
Simon McVittie [Mon, 25 Sep 2017 15:19:39 +0000 (16:19 +0100)]
dbus-send: Reassure the compiler that secondary_type is initialized
It's initialized to a non-trivial value whenever container_type
is DBUS_TYPE_DICT_ENTRY, and subsequently only used if
container_type is DBUS_TYPE_DICT_ENTRY, but Debian's gcc 7.2.0-7
doesn't seem to be able to infer that any more, causing build failure
under -Werror=maybe-uninitialized.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102979
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Mon, 25 Sep 2017 13:57:41 +0000 (14:57 +0100)]
NEWS for fd.o #92074; also note an earlier backport
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 25 Sep 2017 13:57:38 +0000 (14:57 +0100)]
monitor: use the addressed_recipient to select matches
This means we respect the destination keyword in arguments to
BecomeMonitor.
In bus_dispatch(), this means that we need to defer capturing until
we have decided whether there is an addressed recipient; so instead
of capturing once, we capture at each leaf of the decision tree.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92074
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Reviewed-by: Lars Uebernickel <lars@uebernic.de>
(cherry picked from commit
f3be583b40dadfd78ddefbc9fb3fa182bafde949)
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 25 Sep 2017 12:37:57 +0000 (13:37 +0100)]
test/data: Test impossible send_broadcast/send_destination pair
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/92853
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Mon, 25 Sep 2017 12:37:56 +0000 (13:37 +0100)]
config-parser: Fail on impossible send_broadcast/send_destination pair
If we add a rule like
<allow send_destination="com.example" send_broadcast="true"/>
then it cannot possibly match anything, because to be a broadcast, the
message would have to have no destination. The only value of
send_destination that can be combined with send_broadcast="true" is
the wildcard "*", but by this point in the function we already
replaced "*" with NULL.
Adapted from an earlier implementation of send_broadcast by
Alban Crequy.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/92853
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Mon, 25 Sep 2017 12:31:40 +0000 (13:31 +0100)]
NEWS for fd.o #102686
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 22 Sep 2017 20:09:51 +0000 (21:09 +0100)]
unix: Reduce log level for DBUS_SYSTEM_LOG_INFO to LOG_INFO
This is a better match for the way we use it in practice.
Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102686
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Tue, 15 Aug 2017 16:23:15 +0000 (12:23 -0400)]
Merge branch 'dbus-1.10'
Simon McVittie [Tue, 15 Aug 2017 16:22:27 +0000 (12:22 -0400)]
NEWS for #102145
Alan Coopersmith [Fri, 11 Aug 2017 01:50:36 +0000 (18:50 -0700)]
Fix -Werror=declaration-after-statement build failure on Solaris
dbus-sysdeps-unix.c: In function ‘_dbus_read_credentials_socket’:
dbus-sysdeps-unix.c:2061:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
adt_session_data_t *adth = NULL;
^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102145
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Tue, 15 Aug 2017 15:55:38 +0000 (11:55 -0400)]
Update NEWS for fd.o #95264
Signed-off-by: Simon McVittie <smcv@debian.org>
Lennart Poettering [Wed, 4 May 2016 16:06:17 +0000 (18:06 +0200)]
sysdeps: increase listen() backlog of AF_UNIX sockets to SOMAXCONN
Previously, the listen() backlog was set to an arbitrary 30. This means
that if dbus-daemon is overloaded only 30 more connections may be queued
by the kernel, before connect() fails with EAGAIN. (Note that EAGAIN !=
EINPROGRESS -- the latter is what is returned if a connection is queued
and being processed for asynchronous sockets; EAGAIN in this case is
really an error, that cannot be recovered from).
Most software simply sets SOMAXCONN as backlog for AF_UNIX sockets, to
allow queuing of as many connections as the kernel allows. SOMAXCONN is
128 on Linux, which is not particularly high, but at least higher than
30.
This patch changes dbus-daemon to do the same.
I noticed this when flooding dbus-daemon with a lot of connections,
where it pretty quickly ceased to respond, much earlier than it really
should.
Note that the backlog has nothing to do with the number of concurrent
connections allowed, it simply controls how many queued, but not
accept()ed connections there may be on the listening socket.
(cherry picked from commit
12bd6e893c91430fdbdf8a27087d4a792b04eef9)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95264
Bug-Debian: https://bugs.debian.org/872144
Reviewed-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Simon McVittie [Fri, 21 Jul 2017 18:15:05 +0000 (19:15 +0100)]
tests: Use dbus_clear_connection etc. in a couple of tests
This is just enough to demonstrate that they work - I'm deliberately
not doing a mass change throughout all tests, and we should definitely
not rush to introduce these into production code, because it would
hinder cherry-picking and merging fixes between branches. However,
new code on master can use them freely.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101895
Simon McVittie [Fri, 21 Jul 2017 18:12:30 +0000 (19:12 +0100)]
Implement dbus_clear_connection(), etc.
These are inspired by GLib's g_clear_pointer() and g_clear_object(),
which in turn is descended from CPython's Py_CLEAR_OBJECT. They should
make our code a lot less repetitive.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101895
Simon McVittie [Fri, 28 Jul 2017 18:37:12 +0000 (19:37 +0100)]
build: Clean up DBUS_COOKIE_SHA1 keyrings
We use this directory as the temporary home directory.
Fixes:
3f377c511301cfb36bfa93fddf1f59ace8580749
Signed-off-by: Simon McVittie <smcv@debian.org>
Simon McVittie [Fri, 28 Jul 2017 17:50:08 +0000 (18:50 +0100)]
NEWS for #101960
Simon McVittie [Fri, 28 Jul 2017 07:38:20 +0000 (08:38 +0100)]
userdb: Respect $HOME for the home directory of our own uid
This lets cooperating processes with the same value of $HOME
interoperate for DBUS_COOKIE_SHA1 by reading and writing $HOME, even
if their $HOME differs from the uid's "official" home directory
according to getpwuid(). Out of paranoia, we only do this if the uid
and the euid are equal, since if they were unequal the correct thing
to do would be ambiguous.
In particular, Debian autobuilders run as a user whose "official"
home directory in /etc/passwd is "/nonexistent", as a mechanism to
detect non-deterministic build processes that rely on the contents of
the home directory. Until now, this meant we couldn't run dbus'
build-time tests, because every test that used DBUS_COOKIE_SHA1 would
fail in this environment.
In the tests, set HOME as well as DBUS_TEST_HOMEDIR. We keep
DBUS_TEST_HOMEDIR too, because Windows doesn't use HOME, only HOMEDRIVE
and HOMEPATH.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101960
Bug-Debian: https://bugs.debian.org/630152
Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Fri, 28 Jul 2017 10:46:02 +0000 (11:46 +0100)]
NEWS for #101848
Simon McVittie [Wed, 19 Jul 2017 18:43:09 +0000 (19:43 +0100)]
test: Exercise min_fds, max_fds
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Wed, 19 Jul 2017 16:56:38 +0000 (17:56 +0100)]
policy: Add max_fds, min_fds qualifiers for send, receive rules
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101848
Reviewed-by: Thiago Macieira <thiago@kde.org>
[smcv: Revert an incorrect comment change]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 28 Jul 2017 10:27:24 +0000 (11:27 +0100)]
NEWS for #92853
Simon McVittie [Wed, 21 Oct 2015 18:54:38 +0000 (19:54 +0100)]
Add a regression test for applying bus policy to broadcasts/unicasts
This test-case is actually in the test for monitoring the bus,
because it's easier to see what's going on there - the error reply
to a rejected broadcast is not visible unless you are monitoring.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
Simon McVittie [Wed, 19 Jul 2017 14:53:17 +0000 (15:53 +0100)]
Add send_broadcast as an attribute of <allow> and <deny> elements
<allow send_broadcast="true" ...> only matches broadcasts,
which are signals with a NULL destination. There was previously
no way for the policy language to express "NULL destination",
only "any destination".
<allow send_broadcast="false" ...> only matches non-broadcasts,
which are non-signals or signals with a non-NULL destination.
There was previously no way for the policy language to express
"any non-NULL destination", only "any destination".
Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: improved documentation as per Philip's review]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
Simon McVittie [Wed, 19 Jul 2017 14:26:48 +0000 (15:26 +0100)]
dbus-daemon(1): Document how send_* and receive_* work in general
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
Simon McVittie [Wed, 19 Jul 2017 14:52:12 +0000 (15:52 +0100)]
dbus-daemon(1): Be more truthful about the default policy
We don't allow sending unrequested replies, but the documentation
implied that we did.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
Simon McVittie [Wed, 19 Jul 2017 14:46:13 +0000 (15:46 +0100)]
dbus-daemon(1): Clarify how user, group rules work
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
Simon McVittie [Wed, 19 Jul 2017 14:46:00 +0000 (15:46 +0100)]
dbus-daemon(1): Actually document "own" rules
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
Simon McVittie [Wed, 19 Jul 2017 14:43:35 +0000 (15:43 +0100)]
dbus-daemon(1): Document the wildcard attribute value "*" more clearly
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
Simon McVittie [Wed, 19 Jul 2017 13:41:35 +0000 (14:41 +0100)]
Add a test-case for combining receive_type and send_destination
Until the previous commit, this would have worked. Now it correctly fails
with "send and receive attributes cannot be combined".
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
Simon McVittie [Wed, 31 May 2017 13:51:31 +0000 (14:51 +0100)]
config-parser: Clarify how <allow>, <deny> attributes work
The giant conditionals used to check policy attributes are increasingly
unwieldy, so let's try something else. Bundle together the send_
attributes, the receive_ attributes, the eavesdrop attribute
(which can go on either send or receive rules) and the other attributes
into equivalence classes, and write the conditionals in terms of those
equivalence classes.
In particular, this correctly forbids
<allow receive_type="..." send_destination="..."/>
which was previously allowed but nonsensical (the send part took
precedence and the receive part was ignored).
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
Simon McVittie [Fri, 28 Jul 2017 10:22:50 +0000 (11:22 +0100)]
Merge branch 'dbus-1.10'
Simon McVittie [Fri, 28 Jul 2017 10:21:07 +0000 (11:21 +0100)]
NEWS for #101858
Simon McVittie [Fri, 21 Jul 2017 09:46:39 +0000 (10:46 +0100)]
config-loader-expat: Tell Expat not to defend against hash collisions
By default, Expat uses cryptographic-quality random numbers as a salt for
its hash algorithm, and since 2.2.1 it gets them from the getrandom
syscall on Linux. That syscall refuses to return any entropy until the
kernel's CSPRNG (random pool) has been initialized. Unfortunately, this
can take as long as 40 seconds on embedded devices with few entropy
sources, which is too long: if the system dbus-daemon blocks for that
length of time, important D-Bus clients like systemd and systemd-logind
time out and fail to connect to it.
We're parsing small configuration files here, and we trust them
completely, so we don't need to defend against hash collisions: nobody
is going to be crafting them to cause pathological performance.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101858
Tested-by: Christopher Hewitt <hewitt@ieee.org>
[smcv: Adjust build-system changes for 1.11.x]
Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Fri, 21 Jul 2017 09:46:39 +0000 (10:46 +0100)]
config-loader-expat: Tell Expat not to defend against hash collisions
By default, Expat uses cryptographic-quality random numbers as a salt for
its hash algorithm, and since 2.2.1 it gets them from the getrandom
syscall on Linux. That syscall refuses to return any entropy until the
kernel's CSPRNG (random pool) has been initialized. Unfortunately, this
can take as long as 40 seconds on embedded devices with few entropy
sources, which is too long: if the system dbus-daemon blocks for that
length of time, important D-Bus clients like systemd and systemd-logind
time out and fail to connect to it.
We're parsing small configuration files here, and we trust them
completely, so we don't need to defend against hash collisions: nobody
is going to be crafting them to cause pathological performance.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101858
Signed-off-by: Simon McVittie <smcv@debian.org>
Tested-by: Christopher Hewitt <hewitt@ieee.org>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Simon McVittie [Thu, 27 Jul 2017 20:55:32 +0000 (21:55 +0100)]
Start 1.10.24
Signed-off-by: Simon McVittie <smcv@collabora.com>