dbus/tools
Simon McVittie f518165b84 dbus-daemon, dbus-launch: cope with callers having closed standard fds
In Debian bug <https://bugs.debian.org/829348>, lightdm appears to
have been starting dbus-launch with at least one of the three
standard fds 0, 1, 2 (stdin, stdout, stderr) closed. This resulted
in the dbus-daemon's epoll_create1() returning a fd less than 3.
Later, _dbus_become_daemon() replaces fds 0-2 with /dev/null. As a
result, a subsequent call to _dbus_loop_add_watch() for the reload
pipe resulted in calling epoll_ctl on the non-epoll fd pointing to
/dev/null, which fails with EINVAL, resulting in the dbus-daemon
exiting unsuccessfully.

Unix programs are not normally expected to behave correctly when
launched with the standard fds not already open; but at the same time,
X11 autolaunching means that dbus-launch (and hence the dbus-daemon)
can get started from an arbitrarily precarious situation.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97008
Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Thiago Macieira <thiago@kde.org>
(cherry picked from commit c8f73a2a3a)
2016-08-12 10:58:38 +01:00
..
.gitignore Add dbus-test-tool, currently with "echo" and "spam" modes 2014-10-14 13:53:54 +01:00
ci-build.sh add travis-ci.org build machinery 2015-12-02 18:51:08 +00:00
dbus-cleanup-sockets.c dbus-cleanup-sockets: free list of socket entries 2011-01-17 12:18:40 +00:00
dbus-echo.c dbus-test-tool echo: fix sleep documentation 2016-03-02 18:19:35 +00:00
dbus-launch-win.c Fix of 'warning: variable ‘..‘ set but not used [-Wunused-but-set-variable]'. 2015-03-17 16:52:51 +01:00
dbus-launch-x11.c Quote the DBUS_SESSION_BUS_ADDRESS variable in the shell file 2016-06-30 13:51:45 +01:00
dbus-launch.c dbus-daemon, dbus-launch: cope with callers having closed standard fds 2016-08-12 10:58:38 +01:00
dbus-launch.h dbus-launch: use libdbus to read the UUID 2015-02-24 11:16:13 +00:00
dbus-monitor.c dbus-monitor: disable automatic handling of o.fd.Peer messages 2015-07-21 16:50:48 +01:00
dbus-print-message.c Fix assorted compiler warnings on Windows. 2015-03-24 08:27:09 +01:00
dbus-print-message.h dbus-monitor: Add timestamp to --monitor mode. 2015-02-24 13:29:45 +00:00
dbus-run-session.c dbus-run-session: remove various extra variables from the environment 2013-08-23 11:41:16 +01:00
dbus-send.c Fix of 'warning: conversion to ‘dbus_bool_t‘ from ‘int‘ may change the sign of the result [-Wsign-conversion]'. 2015-03-04 12:32:53 +01:00
dbus-spam.c dbus_test_tool_spam: Fix 'variable payload going out of scope leaks the storage it points to' (CID 54759) 2015-05-01 23:04:59 +02:00
dbus-update-activation-environment.c update-activation-environment: produce better diagnostics on error 2016-08-12 09:50:00 +01:00
dbus-uuidgen.c Make UUID generation failable 2015-05-14 14:30:30 +01:00
GetAllMatchRules.py GetAllMatchRules: provide an example how it could be used 2014-10-06 12:10:51 +01:00
lcov.am lcov: use builddir, not srcdir 2015-02-02 18:38:07 +00:00
Makefile.am Move session & system bus configuration to datadir, by default. 2015-05-27 11:49:34 +01:00
run-with-tmp-session-bus.sh Revert "Replace $DBUS_USE_TEST_BINARY with $DBUS_TEST_DBUS_LAUNCH" 2016-02-12 15:25:15 +00:00
strtoll.c Include config.h as the first thing in every .c file 2013-02-22 13:08:27 +00:00
strtoull.c Include config.h as the first thing in every .c file 2013-02-22 13:08:27 +00:00
test-tool.c dbus-test-tool: add black-hole mode 2014-10-14 13:53:59 +01:00
test-tool.h dbus-test-tool: add black-hole mode 2014-10-14 13:53:59 +01:00
tool-common.c Drop duplicated function tool_millisleep() and use dbus_sleep_milliseconds() instead. 2015-03-04 13:06:49 +01:00
tool-common.h Drop duplicated function tool_millisleep() and use dbus_sleep_milliseconds() instead. 2015-03-04 13:06:49 +01:00