I'm trying to write a couple NetworkManager Dispatcher calls to futz with a few things that don't yet have NM capabilities. However I'm running into a snag, particularly with pidgin. Pidgin has a purple-remote call that uses dbus. nm-dispatcher runs as root so I have to switch to my user to accomplish things (currently via su - <user> -c "command args"). Seems though that a 'su - <user>' from root doesn't add the DBUS_SESSION_BUS_ADDRESS env entry, and purple-remote can't find dbus or can't find pidgin on the bus.
How can I programmatically figure out what the dbus address is, or otherwise accomplish what I'm trying to do?
On Sat, 2007-10-27 at 22:54 -0400, Jesse Keating wrote:
I'm trying to write a couple NetworkManager Dispatcher calls to futz with a few things that don't yet have NM capabilities. However I'm running into a snag, particularly with pidgin. Pidgin has a purple-remote call that uses dbus. nm-dispatcher runs as root so I have to switch to my user to accomplish things (currently via su - <user> -c "command args"). Seems though that a 'su - <user>' from root doesn't add the DBUS_SESSION_BUS_ADDRESS env entry, and purple-remote can't find dbus or can't find pidgin on the bus.
How can I programmatically figure out what the dbus address is, or otherwise accomplish what I'm trying to do?
This sounds pretty wrong; root isn't supposed to know about the session bus, and you're going to have a very hard time finding out the address of some random user session bus by design.
If you want to do stuff from your user session, the best bet is to have a session-bus dispatcher daemon. Can you just clone the DBus Example Plugin from pidgin and make it do what you want?
dan
sön 2007-10-28 klockan 01:10 -0400 skrev Dan Williams:
This sounds pretty wrong; root isn't supposed to know about the session bus, and you're going to have a very hard time finding out the address of some random user session bus by design.
Yup. And a user might have multiple sessions on a single computer. Think multiple logins to the guest account, or one log in through GDM and one session established via ssh. Stuff like that happens.
/abo
On Sun, 28 Oct 2007 10:10:28 +0100 Alexander Boström abo@kth.se wrote:
sön 2007-10-28 klockan 01:10 -0400 skrev Dan Williams:
This sounds pretty wrong; root isn't supposed to know about the session bus, and you're going to have a very hard time finding out the address of some random user session bus by design.
Yup. And a user might have multiple sessions on a single computer. Think multiple logins to the guest account, or one log in through GDM and one session established via ssh. Stuff like that happens.
If this is the case, then wouldn't it make sense to have a NetworkManagerDispatcher option to run things in the active session?
On Sun, 2007-10-28 at 07:53 -0400, Jesse Keating wrote:
On Sun, 28 Oct 2007 10:10:28 +0100 Alexander Boström abo@kth.se wrote:
sön 2007-10-28 klockan 01:10 -0400 skrev Dan Williams:
This sounds pretty wrong; root isn't supposed to know about the session bus, and you're going to have a very hard time finding out the address of some random user session bus by design.
Yup. And a user might have multiple sessions on a single computer. Think multiple logins to the guest account, or one log in through GDM and one session established via ssh. Stuff like that happens.
If this is the case, then wouldn't it make sense to have a NetworkManagerDispatcher option to run things in the active session?
Except for the fact that as root, NMD can't find out the session bus address, nor should it be able to.
Dan
sön 2007-10-28 klockan 07:53 -0400 skrev Jesse Keating:
Yup. And a user might have multiple sessions on a single computer. Think multiple logins to the guest account, or one log in through
GDM
and one session established via ssh. Stuff like that happens.
If this is the case, then wouldn't it make sense to have a NetworkManagerDispatcher option to run things in the active session?
I really don't know enough about NM and DBus to understand all the issues, but perhaps it's better if such things go through the system bus? If root or some part of the system wants to tell me something, I should have something that hooks up to the system bus and accepts input of that kind. Would that work? There could be several of those on each system, for different sessions and different users.
/abo
On Sun, 2007-10-28 at 17:02 -0400, Dan Williams wrote:
On Sun, 2007-10-28 at 07:53 -0400, Jesse Keating wrote:
On Sun, 28 Oct 2007 10:10:28 +0100 Alexander Boström abo@kth.se wrote:
sön 2007-10-28 klockan 01:10 -0400 skrev Dan Williams:
This sounds pretty wrong; root isn't supposed to know about the session bus, and you're going to have a very hard time finding out the address of some random user session bus by design.
Yup. And a user might have multiple sessions on a single computer. Think multiple logins to the guest account, or one log in through GDM and one session established via ssh. Stuff like that happens.
If this is the case, then wouldn't it make sense to have a NetworkManagerDispatcher option to run things in the active session?
Except for the fact that as root, NMD can't find out the session bus address, nor should it be able to.
Can't something in the desktop connect to the session bus and get a callback when a dispatch happens there, which it then proxies to a list of session bus dispatchers.
On Sun, 2007-10-28 at 17:02 -0400, Dan Williams wrote:
On Sun, 2007-10-28 at 07:53 -0400, Jesse Keating wrote:
On Sun, 28 Oct 2007 10:10:28 +0100 Alexander Boström abo@kth.se wrote:
sön 2007-10-28 klockan 01:10 -0400 skrev Dan Williams:
This sounds pretty wrong; root isn't supposed to know about the session bus, and you're going to have a very hard time finding out the address of some random user session bus by design.
Yup. And a user might have multiple sessions on a single computer. Think multiple logins to the guest account, or one log in through GDM and one session established via ssh. Stuff like that happens.
If this is the case, then wouldn't it make sense to have a NetworkManagerDispatcher option to run things in the active session?
Except for the fact that as root, NMD can't find out the session bus address, nor should it be able to.
Plus lots of other things as it would have to change user / selinux context etc. etc. I think maybe you want nm-applet (or a NMD with a --session option) to just run stuff from
/etc/NetworkManager/session-dispatcher.d/
as the user of the session. Then the natural progression is that you also want
~/.NetworkManager/session-dispatcher.d
so an unprivileged user can drop stuff in his own home directory that gets run on events. Thoughts?
David
On Mon, 29 Oct 2007 10:54:27 -0400 David Zeuthen davidz@redhat.com wrote:
/etc/NetworkManager/session-dispatcher.d/
as the user of the session. Then the natural progression is that you also want
~/.NetworkManager/session-dispatcher.d
so an unprivileged user can drop stuff in his own home directory that gets run on events. Thoughts?
Seems right to me.
such strange logic you have
maybe its best to redesign the gui completely?
From: Jesse Keating jkeating@redhat.com Reply-To: Discussions about development for the Fedora desktop fedora-desktop-list@redhat.com To: fedora-desktop-list@redhat.com Subject: Re: Detecting dbus session Date: Mon, 29 Oct 2007 11:35:44 -0400
On Mon, 29 Oct 2007 10:54:27 -0400 David Zeuthen davidz@redhat.com wrote:
/etc/NetworkManager/session-dispatcher.d/
as the user of the session. Then the natural progression is that you also want
~/.NetworkManager/session-dispatcher.d
so an unprivileged user can drop stuff in his own home directory that gets run on events. Thoughts?
Seems right to me.
-- Jesse Keating Fedora -- All my bits are free, are yours?
<< signature.asc >>
-- Fedora-desktop-list mailing list Fedora-desktop-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-desktop-list
_________________________________________________________________ Advertisement: Make shopping exciting. Join eBay for free @ www.eBay.com.au http://direct.ninemsn.com.au/adclick/CID=02fda8540000000000000000
Hi,
On Wed, 2007-10-31 at 06:43 +1100, Jack Badger wrote:
such strange logic you have
maybe its best to redesign the gui completely?
There's nothing strange about this; it's just the classic "split code into mechanism and policy" pattern that is widely accepted as a secure practice throughout computing.
David
thats not what i was getting at really, but yea, i get that now anyway.
i'm sort of new to the whole linux thing, and im not that big on coding, i've really only done 3d related, and maybe some visual basic, and some c++, nothing too deep.
designing GUI's is my thing, thats what im good at. ive done a few, none of them have really been adapted for commercial use, but thats mostly because they're been build around a 3d interface, annd weren't practical at the time...
From: David Zeuthen davidz@redhat.com Reply-To: Discussions about development for the Fedora desktop fedora-desktop-list@redhat.com To: Discussions about development for the Fedora desktop fedora-desktop-list@redhat.com Subject: Re: Detecting dbus session Date: Tue, 30 Oct 2007 16:54:07 -0400
Hi,
On Wed, 2007-10-31 at 06:43 +1100, Jack Badger wrote:
such strange logic you have
maybe its best to redesign the gui completely?
There's nothing strange about this; it's just the classic "split code into mechanism and policy" pattern that is widely accepted as a secure practice throughout computing.
David
-- Fedora-desktop-list mailing list Fedora-desktop-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-desktop-list
_________________________________________________________________ Advertisement: It's simple! Sell your car for just $30 at CarPoint.com.au http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2...
desktop@lists.fedoraproject.org