Bug 21620 - System services activation does not respect XDG_DATA_DIRS
Summary: System services activation does not respect XDG_DATA_DIRS
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Simon McVittie
QA Contact: John (J5) Palmieri
URL: http://cgit.freedesktop.org/~smcv/dbu...
Whiteboard:
Keywords: patch
Depends on: 35306
Blocks: dbus-1.5
  Show dependency treegraph
 
Reported: 2009-05-07 11:38 UTC by Marco Pesenti Gritti
Modified: 2012-02-10 02:32 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Explicitly don't search XDG_DATA_DIRS for system services, and document it (5.33 KB, patch)
2012-02-08 08:12 UTC, Simon McVittie
Details | Splinter Review

Description Marco Pesenti Gritti 2009-05-07 11:38:48 UTC
In activation-helper.c we clear the environment before loading the configuration, so we always only see /usr/share:/usr/local/share.
Comment 1 Simon McVittie 2011-04-12 08:28:32 UTC
We also don't respect $XDG_DATA_HOME (or its default) for the system bus, although anything involving the home directory is meaningless for the system bus anyway.

I'm not at all sure that we *should* be respecting XDG_DATA_DIRS for the system bus or system services: it's system-wide and security-sensitive, and the services are meant to be run in a (relatively) "clean", isolated environment similar to the one provided by systemd or Upstart.

What's your use-case for varying this path?

I'd be very tempted to replace this with one of:

- a hard-coded, configure-time search path, with the default being
  something like /usr/local/share:/usr/share:/lib:${datadir}
  (see Bug #35229 which asks to add /lib to the search path, and
  Bug #35306 which asks to document it)

- a configuration option in /etc/system.conf, defaulting to the above

- a hard-coded /usr/local/share:/usr/share:${datadir} (equivalent to what we
  do now), and document that people who don't like that search-path
  should patch their /etc/dbus-1/system.conf to replace
  <standard_system_servicedirs/> with their own preferred search path

Cc Lennart since he also wants to change the search path (to add /lib).
Comment 2 Lennart Poettering 2011-07-28 11:56:56 UTC
I agree with Simon that XDG_DATA_DIRS and friends have little relevance really for system software. I am not totally against software honouring this env var, but I see little reason to fix it do this.
Comment 3 Simon McVittie 2012-02-08 08:12:29 UTC
Created attachment 56756 [details] [review]
Explicitly don't search XDG_DATA_DIRS for system  services, and document it

In practice, it never works, because the activation helper doesn't
respect environment variables for security reasons.
If you want to vary the search path, alter system.conf instead, to
replace or augment <standard_system_servicedirs/> with your preferred
search path.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=21620
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Comment 4 Simon McVittie 2012-02-08 08:13:29 UTC
Review requested.

ssh://people.freedesktop.org/~smcv/dbus.git system-search-paths-21620
Comment 5 Lennart Poettering 2012-02-09 10:49:17 UTC
Looks good to me.
Comment 6 Simon McVittie 2012-02-10 02:30:13 UTC
Thanks, fixed in git for 1.5.10.
Comment 7 Simon McVittie 2012-02-10 02:32:54 UTC
To be clear: the change made here was not actually what Marco requested, it was to stop pretending XDG_* were respected at all for the system bus.

Marco, I assume you were using jhbuild or something? If you're trying to run a sub-system-bus in something like jhbuild, I'm not at all sure that that makes sense... but you can edit system.conf or a file in system.d if you've managed to make a sub-system-bus work and you need a different search path.


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.