[PATCH] client configuration file support

Luiz Augusto von Dentz luiz.dentz at gmail.com
Tue Jun 8 01:48:47 PDT 2010


Hi,

On Tue, Jun 8, 2010 at 9:33 AM, Ralf Habacker <ralf.habacker at freenet.de> wrote:
> Hi,
>
> in situations where using environment variables may not fit into the
> required use cases like gui only environments or embedded environments an
> alternative would be in using a client related configuration file. The
> appended patch contains an initial implementation for this feature.
>
> The client configuration file is expected in the generic config dir
>  (unix:/etc/dbus-1, windows and other: <install-root>/etc/dbus-1) and is
> named client.conf. An example of the related template file client.conf.in
> located in the dbus subdirectory is shown below:
>
> <!-- This configuration file controls how dbus clients access the session
> bus -->
>
> <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Client Configuration
> 1.0//EN"
> "http://www.freedesktop.org/standards/dbus/1.0/clientconfig.dtd">
> <clientconfig>
>   <sessionbus>
>       <connect>@DBUS_SESSION_BUS_CLIENT_DEFAULT_ADDRESS@</connect>
>   </sessionbus>
> </clientconfig>
>
> It allows to set the session bus address and could be extended easily (see
> dbus-config-loader-expat.c)
>
> The appended patch contains the source code for this feature using expat xml
> library and patches for the cmake build system.
>
> The feature is disabled in the build system by default and enabled by a
> configuration switch named DBUS_ENABLE_CLIENT_CONF. Adding this feature to
> autotools build system is very easy (see the related cmake files in the
> patch)
>
> Documentation for this feature is available in a pre release state and when
> ready will be located in <dbus-src-root>/dbus/libdbus.xml (see the appended
> prelimary version)

Does it work in a multi-user environment? It seems to me that any
attempt to hardcode the session address will probably be a failure in
such situations, IMO the correct way to do this is to have this
configuration placed somewhere in the home of the user but it seems
someone already did this in linux:

~/.dbus/session-bus$ cat 646e76324b65880a35770fad4b195e87-1
# This file allows processes on the machine with id
646e76324b65880a35770fad4b195e87 using
# display :1 to find the D-Bus session bus with the below address.
# If the DBUS_SESSION_BUS_ADDRESS environment variable is set, it will
# be used rather than this file.
# See "man dbus-launch" for more details.
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-T15jBilHQz,guid=a0cd145e5964cbaeb08ef6dc4b83cdbb
DBUS_SESSION_BUS_PID=28045
DBUS_SESSION_BUS_WINDOWID=10485761

-- 
Luiz Augusto von Dentz
Computer Engineer


More information about the dbus mailing list