Hi,<br><br>First, thx for the reply.<br><br>I follow your advises but I am still not able to use dbus. <br>This is my configuration and the result:<br><br>- I am launching dbus-daemon.exe --system in a system service (using CreateProcess).<br>
So in task manager I can see that the user name of the dbus-daemon process is "SYSTEM" (because of system service)<br>- then I open a console and I type: set DBUS_SYSTEM_BUS_ADDRESS=tcp:host=localhost,port=12434<br>
- then I run: <br>dbus-send --print-reply --system --dest="org.freedesktop.DBus" /org/freedesktop /DBus/Introspectable org.freedesktop.DBus.Introspectable.Introspect<br><br>-> the result:<br>------<br>Family none<br>
Failed to open connection to system message bus: Did not receive a reply. Possib<br>le causes include: the remote application did not send a reply, the message bus<br>security policy blocked the reply, the reply timeout expired, or the network con<br>
nection was broken.<br>-----<br><br>I get the same result with or without typing:<br>set DBUS_SYSTEM_BUS_ADDRESS=tcp:host=localhost,port=12434<br><br>But if I am using CreateProcessAsUser instead of CreateProcess (in the service run), in order to have "Administrator" as the user name associated with the dbus-daemon process, then it works.<br>
<br>So I still cannot use dbus with severals users.<br>Anyway, the result is at least better than using --session.<br>Here it seems that something is not correct (for my needs) in the system.conf file.<br><br>So here is the system.conf file I am using:<br>
----------------------------------------------------------------------------------------------------------------------<br><!-- This configuration file controls the systemwide message bus.<br> Add a system-local.conf and edit that rather than changing this<br>
file directly. --><br><br><!-- Note that there are any number of ways you can hose yourself<br> security-wise by screwing up this file; in particular, you<br> probably don't want to listen on any more addresses, add any more<br>
auth mechanisms, run as a different user, etc. --><br><br><!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"<br> "<a href="http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd</a>"><br>
<busconfig><br><br> <!-- Our well-known bus type, do not change this --><br> <type>system</type><br><br> <!-- Run as special user --><br> <user>Administrator</user><br><br> <!-- Fork into daemon mode --><br>
<fork/><br><br> <!-- Write a pid file --><br> <pidfile>/dbus-pid</pidfile><br><br> <!-- Only allow socket-credentials-based authentication --><br> <auth>EXTERNAL</auth><br><br>
<!-- Only listen on a local socket. (abstract=/path/to/socket<br> means use abstract namespace, don't really create filesystem<br> file; only Linux supports this. Use path=/whatever on other<br> systems.) --><br>
<listen>tcp:host=localhost,port=12434</listen><br><br> <policy context="default"><br> <!-- Deny everything then punch holes --><br> <deny send_interface="*"/><br>
<deny receive_interface="*"/><br> <deny own="*"/><br> <!-- But allow all users to connect --><br> <allow user="*"/><br> <!-- Allow anyone to talk to the message bus --><br>
<!-- FIXME I think currently these allow rules are always implicit<br> even if they aren't in here --><br> <allow send_destination="org.freedesktop.DBus"/><br> <allow receive_sender="org.freedesktop.DBus"/><br>
<!-- valid replies are always allowed --><br> <allow send_requested_reply="true"/><br> <allow receive_requested_reply="true"/><br> </policy><br><br> <!-- Config files are placed here that among other things, punch<br>
holes in the above policy for specific services. --><br> <includedir>system.d</includedir><br><br> <!-- This is included last so local configuration can override what's<br> in this standard file --><br>
<include ignore_missing="yes">system-local.conf</include><br><br> <include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include><br>
<br></busconfig><br>----------------------------------------------------------------------------------------------------------------------<br><br>Any help would be much appreciated.<br>Sincerely<br>Julien<br><br><br>
<div class="gmail_quote">2009/11/19 Ralf Habacker <span dir="ltr"><<a href="mailto:ralf.habacker@freenet.de">ralf.habacker@freenet.de</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Julien Isorce schrieb:<div class="im"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I isolated the problem I am facing to:<br>
<br>
If I run the dbus-daemon with a userA<br>
and if I run dbus-send with a userB<br>
then the result is the same as if the dbus-daemon was not running (so it fails)<br>
(it's ok if the 2 users are the same)<br>
</blockquote></div>
By default the dbus library and the daemon provides a session bus which is user specific and only accessable by the same user.<br>
<br>
In your case you need to run dbus-daemon as system bus by<br>
<br>
dbus-daemon --system<br>
<br>
then set an environment variable to the recent system bus address (see <listen> statement in <dbus-install-root>/etc/system.conf for details)<br>
<br>
set DBUS_SYSTEM_BUS_ADDRESS=tcp:host=localhost,port=12434<br>
<br>
and run for example<br>
<br>
qdbus --system<br>
<br>
to get a list of possible connections. In my case this is<br>
<br>
:1.6<br>
:1.9<br>
org.freedesktop.DBus<br>
<br>
dbus-send should then work also.<br>
<br>
Regards<br><font color="#888888">
Ralf<br>
</font></blockquote></div><br>