Re: Setting a "user" profile in code?



On Wed, 2009-08-26 at 13:08 -0600, Chris Hessing wrote:
> Hi All,
>  
> I found this URL
> http://osdir.com/ml/networkmanager-list/2009-07/msg00035.html that
> described how to set up a system level configuration for Network
> Manager.  It was extremely helpful in getting some code in Qt to do
> the same thing.   However, now I want to be able to set up the same
> type of configuration using a user level configuration (for the
> current user running my program).
>  
> I have tried the obvious solution of sending to
> org.freedesktop.NetworkManagerSystemSettings, but I get an error back
> that seems to indicate I have violated a rule about who is allowed to
> create connections for the user profile.  The error is :
>  
> org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 1
> matched rules; type="method_call", sender=":1.1160" (uid=1000
> pid=16983 comm="/usr/bin/python ./addconn_orig ")
> interface="org.freedesktop.NetworkManagerSettings.System"
> member="AddConnection" error name="(unset)" requested_reply=0
> destination=":1.27" (uid=1000 pid=3243 comm="nm-applet --sm-disable
> "))

At the moment, for the Gnome applet, you cannot add/remove/update
connections via D-Bus.  That's because I haven't figured out a way yet
to allow access to the secrets (wep & wpa keys, passwords, etc) without
circumventing the Keyring's access control mechanisms.  These mechanisms
are meant to ensure the user knows exactly which programs are accessing
their passwords, and to allow/deny access to secrets.  If we just let
any program update a connection over dbus, then the keyring requests
would look like they were coming from nm-applet, and thus obscure the
*real* program that was trying to access the keyring.  So that's the
only thing blocking add/update/delete via D-Bus for the gnome applet.
 
> Is there any way, short of changing the rules, to have another program
> set up a connection on a stock Ubuntu distro?

You can use gconftool-2 to import the connection details (minus secrets)
directly to GConf, which the applet will then pick up.  You can also use
gconftool-2 to export existing connections to XML.

Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]