Summary: | Drop chdir("/") in dbus-launch | ||
---|---|---|---|
Product: | dbus | Reporter: | David King <amigadave> |
Component: | core | Assignee: | D-Bus Maintainers <dbus> |
Status: | RESOLVED MOVED | QA Contact: | D-Bus Maintainers <dbus> |
Severity: | normal | ||
Priority: | medium | Keywords: | patch |
Version: | git master | ||
Hardware: | Other | ||
OS: | All | ||
See Also: | https://bugzilla.redhat.com/show_bug.cgi?id=1470310 | ||
Whiteboard: | review? | ||
i915 platform: | i915 features: | ||
Attachments: |
drop the chdir("/") call from dbus-launch
use HOME as the working directory, if it is set |
Description
David King
2018-06-21 10:26:34 UTC
Created attachment 140258 [details] [review] drop the chdir("/") call from dbus-launch dbus-launch definitely needs to chdir() to *somewhere* predictable that no user is going to want to delete or unmount, for the same reasons that well-behaved system services chdir("/") during daemonization. dbus-launch can be started in several ways: * By a session manager like gnome-session * By OS-distribution desktop infrastructure like Debian's /etc/X11/Xsession.d (I think Red Hat has this under a different name involving xinit) * Explicitly by a (possibly misguided) user * Implicitly by libdbus (or GDBus) for X11 autolaunching There's some background in <https://lists.debian.org/debian-devel/2016/08/msg00554.html>. In the X11 autolaunching case it's a child of an arbitrarily-chosen user process (whichever one happens to be the first to try to use the session bus), which might be in an arbitrarily annoying directory. Moving to the user's home directory as a sort of per-user equivalent of "/" would be a defensible change. I'm a little hesitant to make that change because dbus-launch is not a focus of development for Linux systems (the "user session" model with dbus-daemon --session managed by systemd --user seems like a better future), and dbus-launch has had its current behaviour for around 15 years... (In reply to Simon McVittie from comment #2) >… > There's some background in > <https://lists.debian.org/debian-devel/2016/08/msg00554.html>. Thanks for the background! >… > Moving to the user's home directory as a sort of per-user equivalent of "/" > would be a defensible change. I'm a little hesitant to make that change > because dbus-launch is not a focus of development for Linux systems (the > "user session" model with dbus-daemon --session managed by systemd --user > seems like a better future), and dbus-launch has had its current behaviour > for around 15 years... My reasoning for this change would be that systemd --user has effectively changed the default working directory of dbus-daemon when used as a session bus to be the user's home directory. From that point of view, it makes sense that when dbus-launch is used in the same capacity, it sets the current working directory in the same (or a similar) way. I am not sure whether changing the default behaviour of dbus-launch to match the working directory of dbus-daemon launched by systemd --user makes sense, or if the behaviour should be opt-in. The working directory does not appear to be documented outside of the comment, but is common for persistent daemons, so is implied. Created attachment 140280 [details] [review] use HOME as the working directory, if it is set -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus/issues/214. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.