On 06/02/15 03:32, 张洋 wrote:
dbus-daemon --session --print-address --fork > /tmp/session_amgr

This is a security flaw (the search keywords to look for are "symlink attack").

export DBUS_SESSION_BUS_ADDRESS=`cat /tmp/session_amgr`

This only affects the environment of the shell script that is about to exit, rendering it relatively useless. To set an environment variable for systemd, use "systemctl import-environment DBUS_SESSION_BUS_ADDRESS" - but don't do that for the system instance of systemd, it is not appropriate for random system services to share a session bus.

The question to ask yourself when dealing with the session bus and system services, what does "session" mean on your platform, and whose session is it (as in which uid)? The right way to manage your session follows from the answers to those questions.

For an embedded system, you probably want the "user session" enhancement for dbus, which I'm currently upstreaming into dbus 1.9.x.

Regards,
    S

--
Simon McVittie
Collabora Ltd. <http://www.collabora.com/>

_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to