dbus/bus
Chengwei Yang 8b3681e35d When "activating" systemd, handle its special case better
When dbus-daemon receives a request to activate a systemd service before
systemd has connected to it, it enqueues a fake request to "activate"
systemd itself (as a way to get a BusPendingActivationEntry to track the
process of waiting for systemd). When systemd later joins the bus,
dbus-daemon sends the actual activation message; any future activation
messages are sent directly to systemd.

In the "pending" code path, the activation messages are currently
dispatched as though they had been sent by the same process that sent
the original activation request, which is wrong: the bus security
policy probably doesn't allow that process to talk to systemd directly.
They should be dispatched as though they had been sent by the
dbus-daemon itself (connection == NULL), the same as in the non-pending
code path.

In the worst case, if the attempt to activate systemd timed out, the
dbus-daemon would crash with a (fatal) warning, because in this special
case, activation_message is a signal with no serial number, whereas the
code to send an error reply is expecting a method call with a serial
number.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=50199
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Tested-by: Ma Yu <yu.ma@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-06-05 16:33:59 +01:00
..
.gitignore Ignore generated bus/org.freedesktop.dbus-session.plist 2010-12-15 09:43:11 +01:00
activation-exit-codes.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
activation-helper-bin.c Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
activation-helper.c activation helper: when compiled for tests, do not reset system bus address 2012-10-04 08:17:27 +01:00
activation-helper.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
activation.c When "activating" systemd, handle its special case better 2013-06-05 16:33:59 +01:00
activation.h activation: optionally, use systemd for system bus activation 2010-07-09 19:47:23 +02:00
bus.c Do not suppress syslog test's stderr just because init is systemd 2013-04-08 12:17:28 +01:00
bus.h Replace a series of booleans, all (apparently) alike, with flags 2012-02-13 17:39:16 +00:00
config-loader-expat.c Fixed gcc on windows limitation 2010-03-20 21:53:57 +01:00
config-loader-libxml.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
config-parser-common.c Do not use the name ELEMENT_TYPE 2011-03-07 13:50:38 +00:00
config-parser-common.h Do not use the name ELEMENT_TYPE 2011-03-07 13:50:38 +00:00
config-parser-trivial.c Fix spelling/grammatical mistakes detected by Debian's lintian(1) 2011-07-28 11:05:43 +01:00
config-parser-trivial.h Merge branch 'dbus-1.2' 2010-06-22 17:25:20 +01:00
config-parser.c Set default maximum number of Unix fds according to OS 2013-04-11 13:34:55 +01:00
config-parser.h Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
connection.c Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication method 2012-04-12 10:53:50 -04:00
connection.h Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
dbus.service.in dbus.service.in: Do not order after syslog.target 2013-04-22 16:17:48 +01:00
dbus.socket.in systemd: enable the dbus service unconditionally 2010-09-06 03:21:17 +02:00
desktop-file.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
desktop-file.h activation: optionally, use systemd for system bus activation 2010-07-09 19:47:23 +02:00
dir-watch-default.c Fix warnings on Windows builds. 2010-04-14 08:26:40 +02:00
dir-watch-dnotify.c Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
dir-watch-inotify.c Fix inotify usage for QNX 2013-02-21 13:11:19 +00:00
dir-watch-kqueue.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
dir-watch.h Clean up inotify watch handling 2010-02-01 16:22:56 -05:00
dispatch.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
dispatch.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
driver.c bus driver: factor out common code to get a named connection 2013-02-27 19:34:36 +00:00
driver.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
expirelist.c Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication method 2012-04-12 10:53:50 -04:00
expirelist.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
main.c Replace a series of booleans, all (apparently) alike, with flags 2012-02-13 17:39:16 +00:00
Makefile.am Revert "made session service dirs customizable: autotools part" 2012-01-04 18:19:58 +00:00
messagebus-config.in Applied patches from cygwin port. 2010-08-10 08:25:24 +02:00
messagebus.in Fix use of $servicename in status 2010-07-09 11:52:59 -04:00
org.freedesktop.dbus-session.plist.in 10.4 is old so set more sensible launchd defaults. 2010-12-09 08:20:07 +01:00
policy.c test: enforce own_prefix policy rules 2012-03-22 11:51:23 +00:00
policy.h test: enforce own_prefix policy rules 2012-03-22 11:51:23 +00:00
rc.messagebus.in [legacy init script] Fix the use of $servicename 2010-04-23 12:02:19 -04:00
selinux.c capng: Drop supplemental groups when switching to daemon user 2011-08-11 10:54:45 +01:00
selinux.h Fix compilation in --disable-selinux case 2010-02-02 15:04:58 -05:00
services.c policy: remove unused parameter 2012-03-22 11:28:58 +00:00
services.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
session.conf.in Rename default_message_unix_fds to DEFAULT_MESSAGE_UNIX_FDS 2013-04-18 19:21:51 +01:00
signals.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
signals.h Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
stats.c Revert addition of files which were only meant to exist on master, too 2012-01-23 10:27:32 +00:00
stats.h Revert addition of files which were only meant to exist on master, too 2012-01-23 10:27:32 +00:00
system.conf.in Clean up and clarify default system policy 2008-12-18 15:34:24 -05:00
test-launch-helper.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
test-main.c Move _dbus_check_fdleaks_enter to dbus-message-internal.h 2012-02-21 14:51:21 +00:00
test-system.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
test.c Replace a series of booleans, all (apparently) alike, with flags 2012-02-13 17:39:16 +00:00
test.h Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
utils.c Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
utils.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00