Seeing the session bus as another user

Stuart Langridge sil at kryogenix.org
Tue Mar 6 23:47:34 PST 2007


On 3/7/07, David Zeuthen <david at fubar.dk> wrote:
> On Wed, 2007-03-07 at 02:44 +0000, Stuart Langridge wrote:
> > I'd like PHP scripts on my machine, running as www-data, to be able to
> > display notifications on my desktop (since someone mentioned that they
> > do a similar trick with Growl on OS X:
> > http://www.aquarionics.com/article/name/Debugging_Ajax and it sounded
> > useful).
>
> I'm pretty sure that programs outside a session should never have access
> to the session bus as that would have severe security implications.
> Instead, I think what you want to do is to make PHP emit signals on the
> system bus (you don't even have to own the service all the time) and
> then your client in the desktop session can pick those up and display
> notifications.

In case I'm missing something here: you're suggesting that I run a
separate daemon in my session which listens on the system bus and then
"forwards" the messages to the already-listening notification-daemon
on the session bus, yes? The reason I'm hoping to avoid that is that
it makes my instructions for "how to have PHP display notifications to
you, Mr User" be:

1. edit /etc/dbus-1/session-local.conf
2. download this program (the tiny forwarding daemon) and save it somewhere
3. run the forwarding daemon
4. add the forwarding daemon to your session so it'll run every time
5. download the PHP library and call it from your code to get notifications

which is rather overcomplicated :(

What I'd like is

1. edit /etc/dbus-1/session-local.conf
2. download the PHP library and call it from your code to get notifications

hence not wanting to run a forwarding daemon. If it really is the only
way to do it then I suppose that's the way it'll have to be, but I was
hoping to avoid the complexity.

sil


-- 
Penelope Pitstop: Ohhh, it's my arch enemy, the Hooded Claw!
The Hooded Claw: Who did you expect? Dick Dastardly?
             -- The Perils of Penelope Pitstop, "Jungle Jeopardy"


More information about the dbus mailing list