summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-10-06UNTESTED: Windows: Stop manipulating line numbering in versioninfo.rcuntested-cmake-rcSimon McVittie2-5/+0
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>
2017-10-06UNTESTED: cmake: Stop creating an empty afxres.hSimon McVittie1-1/+0
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>
2017-10-03Post-release version bump (and add release name)Simon McVittie2-1/+8
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-03Prepare 1.11.20Simon McVittie2-3/+3
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-03Clarify NEWSSimon McVittie1-2/+3
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-09-29Update NEWSSimon McVittie1-1/+27
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-09-29unix: Condition Linux-specific abstract sockets on __linux__Simon McVittie8-132/+7
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-29build: Remove unused substitution DBUS_PATH_OR_ABSTRACTSimon McVittie3-28/+0
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-28build: Remove unused variablesSimon McVittie1-8/+1
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>
2017-09-28dbus: Actually link versioninfo.o into libdbusSimon McVittie1-0/+1
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>
2017-09-28dbus: Clarify why we are not just adding the resource file to SOURCESSimon McVittie1-1/+6
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>
2017-09-28dbus: Make SUFFIXES more specificSimon McVittie1-1/+1
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>
2017-09-28ci-build: Use a mirror of mingw binaries, not msys2 binariesSimon McVittie1-1/+1
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-09-27Add Windows manifest to dbus-update-activation-environment.exeRalf Habacker3-2/+34
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>
2017-09-27ci-build: Use a mirror that hopefully works better than SourceforgeSimon McVittie1-1/+1
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-09-27sysdeps: Stop pretending _dbus_set_signal_handler is portable to WindowsSimon McVittie3-18/+6
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>
2017-09-27Make sure non-aborting signal handlers save and restore errnoSimon McVittie2-0/+12
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>
2017-09-27tests: In slower tests, make the timeout per-test-caseSimon McVittie5-5/+46
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>
2017-09-27test-utils-glib: Try to emit TAP diagnostics before abortingSimon McVittie1-2/+14
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>
2017-09-26Post-release version bumpSimon McVittie2-1/+6
2017-09-25Prepare 1.11.18 releaseSimon McVittie2-4/+6
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-09-25Remove distribution-specific init-scriptsSimon McVittie6-428/+28
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-25Deprecate the pam_console/pam_foreground flag-file directorySimon McVittie5-18/+33
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-25Merge branch 'dbus-1.10'Simon McVittie1-0/+2
2017-09-25dbus-send: Reassure the compiler that secondary_type is initializedSimon McVittie1-0/+2
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>
2017-09-25NEWS for fd.o #92074; also note an earlier backportSimon McVittie1-1/+4
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-09-25monitor: use the addressed_recipient to select matchesSimon McVittie7-50/+247
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>
2017-09-25test/data: Test impossible send_broadcast/send_destination pairSimon McVittie2-0/+7
Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/92853 Reviewed-by: Philip Withnall <withnall@endlessm.com>
2017-09-25config-parser: Fail on impossible send_broadcast/send_destination pairSimon McVittie1-0/+13
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>
2017-09-25NEWS for fd.o #102686Simon McVittie1-0/+4
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-09-25unix: Reduce log level for DBUS_SYSTEM_LOG_INFO to LOG_INFOSimon McVittie1-1/+1
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>
2017-08-15Merge branch 'dbus-1.10'Simon McVittie2-4/+8
2017-08-15NEWS for #102145Simon McVittie1-0/+3
2017-08-15Fix -Werror=declaration-after-statement build failure on SolarisAlan Coopersmith1-4/+5
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>
2017-08-15Update NEWS for fd.o #95264Simon McVittie1-0/+4
Signed-off-by: Simon McVittie <smcv@debian.org>
2017-08-15sysdeps: increase listen() backlog of AF_UNIX sockets to SOMAXCONNLennart Poettering1-1/+1
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>
2017-07-30tests: Use dbus_clear_connection etc. in a couple of testsSimon McVittie2-117/+82
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
2017-07-30Implement dbus_clear_connection(), etc.Simon McVittie8-0/+138
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
2017-07-28build: Clean up DBUS_COOKIE_SHA1 keyringsSimon McVittie1-0/+3
We use this directory as the temporary home directory. Fixes: 3f377c511301cfb36bfa93fddf1f59ace8580749 Signed-off-by: Simon McVittie <smcv@debian.org>
2017-07-28NEWS for #101960Simon McVittie1-0/+8
2017-07-28userdb: Respect $HOME for the home directory of our own uidSimon McVittie3-1/+14
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>
2017-07-28NEWS for #101848Simon McVittie1-0/+11
2017-07-28test: Exercise min_fds, max_fdsSimon McVittie3-0/+171
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-28policy: Add max_fds, min_fds qualifiers for send, receive rulesSimon McVittie6-4/+146
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>
2017-07-28NEWS for #92853Simon McVittie1-0/+8
2017-07-28Add a regression test for applying bus policy to broadcasts/unicastsSimon McVittie2-5/+203
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
2017-07-28Add send_broadcast as an attribute of <allow> and <deny> elementsSimon McVittie4-2/+66
<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
2017-07-28dbus-daemon(1): Document how send_* and receive_* work in generalSimon McVittie1-0/+26
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
2017-07-28dbus-daemon(1): Be more truthful about the default policySimon McVittie1-3/+7
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
2017-07-28dbus-daemon(1): Clarify how user, group rules workSimon McVittie1-8/+12
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