Commit graph

436 commits

Author SHA1 Message Date
Simon McVittie
e57120cb65 build: Drop support for non-POSIX getpwnam_r(), getgrnam_r()
Solaris 2.3 and 2.4 took their getpwnam_r() signature from draft 6
of the POSIX threads standard. Since Solaris 2.5 (1995), defining
_POSIX_PTHREAD_SEMANTICS opts-in to the non-draft version of
getpwnam_r(), and since Solaris 11.4 (2018), the non-draft version is
the default.

We already use AC_USE_SYSTEM_EXTENSIONS, which defines
_POSIX_PTHREAD_SEMANTICS, among other useful macros.

Thanks to Alan Coopersmith for assistance with Solaris history.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-11-19 11:27:38 +00:00
Simon McVittie
f33038bc1b build: Require va_copy() or __va_copy() on non-MSVC compilers
va_copy() is a C99 feature, and should be widely supported by now.
gcc in strict C89 mode implements an equivalent __va_copy() instead.

MSVC 2013 implements va_copy(), but at the moment we still aim to support
MSVC 2010 and 2012, which don't have it. However, we know that in
Windows ABIs, va_list is a pointer, so we can use
_DBUS_VA_COPY_ASSIGN. We do not support MSVC for Autotools builds, only
CMake, due to its non-Unixish command-line interface.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-11-19 11:27:25 +00:00
Simon McVittie
6278951f6d Don't check how to copy a va_list if we already have va_copy()
If we already have ISO C va_copy() or its non-standard counterpart
__va_copy(), then there's no need to do an AC_RUN_IFELSE or its
CMake equivalent to detect whether "args2 = args1" or "*args2 = *args1"
works. AC_RUN_IFELSE is problematic during cross-compilation, where the
program cannot be run (you have to know in advance that the test program
will be run and what its result will be), so we want to avoid it whenever
possible.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-11-19 11:27:25 +00:00
Simon McVittie
e8a2e1dcea build: Simplify checks for straightforward header files
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-11-19 11:05:17 +00:00
Simon McVittie
1b0e79cb43 build: Simplify checks for functions with no special dependencies
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-11-19 11:05:17 +00:00
Simon McVittie
f93b63587f internals: Assume compiler supports a subset of ISO varargs syntax
We have considerable anecdotal evidence that every relevant compiler
supports at least the small part of ISO varargs syntax that we need
here, because tools/tool-common.h has contained

    #define VERBOSE(...) do {} while (0)

since dbus 1.9.2 (2014) and nobody has complained yet. With that in
mind, let's simplify.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-11-15 18:55:57 +00:00
Ralf Habacker
696a6b629d Avoid double slashes in paths created by pkg-config
If in a .pc variable a path is created from another
variable, such as exec_prefix=${prefix}/lib, prefix
must not contain a trailing slash to avoid double
slashes in the generated path.
2018-11-15 13:12:48 +00:00
Ralf Habacker
9455d3542a Use same name for DBUS_HAVE_LINUX_EPOLL cpp macro and Automake conditional
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
2018-10-24 10:03:29 +02:00
Simon McVittie
0414ea65ca build: Never use poll() on Darwin family (macOS, etc.) or Interix
Doing a runtime check in configure.ac (AC_RUN_IFELSE) has several
disadvantages:

* It doesn't work when cross-compiling. For example, if we build macOS
  binaries on a Linux system, we'd assume that poll() works, but in
  fact it won't.

* It checks the build system capabilities, but that is not necessarily
  appropriate if (for example) a macOS 10.10 user builds binaries that
  could be used by macOS 10.12 or macOS 10.9 users.

* It checks for one specific failure mode, but macOS seems to have a
  history of various implementation issues in poll().

* If we want it to work in CMake, we have to duplicate it in the CMake
  build system.

None of these is a showstopper on its own, but the combination of all
of them makes the current approach to avoiding the broken poll() on
macOS look unreliable. libcurl, a widely-portable library making
extensive use of sockets, specifically doesn't use poll() on Darwin
(macOS, iOS, etc.) or on Interix; let's follow their example here.

See also https://bugzilla.gnome.org/show_bug.cgi?id=302672 and
https://daniel.haxx.se/blog/2016/10/11/poll-on-mac-10-12-is-broken/
for some relevant history.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/232
2018-10-22 16:45:33 +00:00
Simon McVittie
30141d0bd3 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>
2018-10-22 12:47:53 +01:00
Ralf Habacker
c174a8e886 configure.ac: Remove unused HAVE_V*PRINTF macros
The corresponding functions are used unconditionally.

Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-10-19 12:50:31 +01:00
Simon McVittie
29b2b55c39 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
2018-08-30 17:44:20 +01:00
Simon McVittie
7cae8b427c 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
2018-08-30 17:44:08 +01:00
Francesco Turco
b805744029 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
2018-08-29 17:57:43 +01:00
Simon McVittie
e93b421137 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
2018-08-29 17:57:22 +01:00
Simon McVittie
f96431b409 1.13.7 2018-08-03 01:01:11 +01:00
Simon McVittie
91e17e7685 1.13.6 2018-08-02 19:34:51 +01:00
Simon McVittie
7c7786ae27 Start development of 1.13.6
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-04-30 17:48:31 +01:00
Simon McVittie
171fccffdb 1.13.4 2018-04-30 13:54:17 +01:00
Ralf Habacker
39efd6ebdd Add version info to installed executables for cmake build system on Windows
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=103387
2018-03-12 19:47:28 +01:00
Simon McVittie
83549e28ec Windows: Target Windows Vista or higher
This will give us the RFC-2553 inet_ntop() interface.
Windows Vista extended security support ended in 2017, but we don't
actually need anything from versions newer than Vista yet.

Loosely based on part of a patch by Ralf Habacker.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-09 12:26:08 +00:00
Simon McVittie
454ffd0d0e Start developing 1.13.4
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-03-02 14:47:36 +00:00
Simon McVittie
0b4cbb8fb6 1.13.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-03-01 18:15:59 +00:00
Simon McVittie
49ca421997 Add a unit test for the dbus-daemon resetting its fd limit
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
2018-02-20 18:37:30 +00:00
Simon McVittie
02170d6fa6 Start towards 1.13.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-02-08 23:37:01 +00:00
Simon McVittie
ee84f84a3f 1.13.0
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-02-08 14:32:31 +00:00
Benedikt Heine
d5c2e5539f Resolve bindir variable in dbus-1.pc file correctly
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104265
Reviewed-by: Simon McVittie <smcv@collabora.com>
2017-12-14 14:58:39 +00:00
Simon McVittie
88b3c31928 driver: Add a stub implementation of the Containers1 interface
For now, this is considered to be a privileged operation, because the
resource-limiting isn't wired up yet. It only contains the bare minimum
of API.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354
2017-12-11 15:50:02 +00:00
Simon McVittie
d5742550ca Add a simplified backport of g_steal_pointer()
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
2017-11-06 14:07:21 +00:00
Simon McVittie
83b439f7b4 cmake: Match AC_DEFINE more precisely, respecting [] quoting
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
2017-11-06 14:07:21 +00:00
Simon McVittie
f7875ebff6 Use a micro version that won't break DBUS_VERSION
DBUS_VERSION assumes that major/minor/micro are numeric and less than
256 each.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-11-06 14:00:22 +00:00
Simon McVittie
9ebf0004d1 Bump version for 1.13.x branch
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-30 14:49:26 +00:00
Simon McVittie
f163a0e28d Merge branch 'dbus-1.12' 2017-10-30 14:45:29 +00:00
Simon McVittie
98294ab81a Prepare 1.12.0
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-30 12:37:23 +00:00
Simon McVittie
93efaf7873 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>
2017-10-30 12:31:03 +00:00
Simon McVittie
dd89b359f0 Start towards 1.11.24 (or maybe 1.12.0)
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-23 15:21:58 +01:00
Simon McVittie
f87fea641f Prepare 1.11.22
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-23 11:29:57 +01:00
Simon McVittie
8f84d2d250 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>
2017-10-18 12:46:53 +01:00
Simon McVittie
eacb639098 Post-release version bump (and add release name)
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-03 10:46:19 +01:00
Simon McVittie
b0fc11c41f Prepare 1.11.20
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-03 07:46:29 +01:00
Simon McVittie
6a6521746b 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>
2017-09-29 14:04:57 +01:00
Simon McVittie
633a208ce7 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>
2017-09-29 14:04:38 +01:00
Simon McVittie
1330bd2cd3 Post-release version bump 2017-09-26 00:34:39 +01:00
Simon McVittie
f45c994151 Prepare 1.11.18 release
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-09-25 20:58:54 +01:00
Simon McVittie
708a44d07a 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>
2017-09-25 20:28:46 +01:00
Simon McVittie
2aaa650939 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>
2017-09-25 20:28:02 +01:00
Simon McVittie
8d8b5eb8a4 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>
2017-07-28 11:17:04 +01:00
Simon McVittie
962bfdd992 Belatedly bump the libtool versioning
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-27 21:24:13 +01:00
Simon McVittie
1d94d3383d Start towards 1.11.18
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-27 21:24:04 +01:00
Simon McVittie
9f63efe8f3 1.11.16 2017-07-27 13:57:27 +01:00