Re: Problem to add a broadband connection on NetworkManagerUserSettings

2010-01-21 Thread Maxwell Chiareli Xandeco

Hi guys,

I tried with SystemSettings before use UserSettings and really works,
but when you create a connection with "SystemSettings", it's marked as
"Available for all users", and when you use this kind of connection, you
just can use once, the second time crashes the system, there is a lot of
issues opened on launchpad about it, because of that I need to use
UserSettings.

Happens for broadband and DSL connections, may be to wireless too, it's
not just about connections created with my own code, I tried with
nm-applet, if you check available for all uses, don't works.

If someone knows some workaround to get SystemSettings working, I can
use it.

Thanks guys for your help, and sorry again about the "Legal message",
it's not my faul, but I'll start use other email.

Maxwell

On Tue, 2010-01-19 at 16:45 +0100, Jirka Klimes wrote:

> On Wednesday 13 January 2010 16:33:27 Maxwell Chiareli Xandeco wrote:
> > I'm using Ubuntu 9.10, with your code I don't get errors but a
> > connection is not added, nothing happens when I call AddConnection
> > method.
> >
>
> I've investigated it a bit and found out that AddConnection is not supported
> via D-Bus due to security reasons.
> (src/gconf-helpers/nma-gconf-settings.c:add_connection() function)
>
> If you use SystemSettings service instead of UserSettings, the connection
> adding will work (just keyfile plugin).
>
> Jirka



 
Legal Disclaimer:
The information contained in this message may be privileged and confidential. 
It is intended to be read only by the individual or entity to whom it is 
addressed or by their designee. If the reader of this message is not the 
intended recipient, you are on notice that any distribution of this message, in 
any form, is strictly prohibited. If you have received this message in error, 
please immediately notify the sender and delete or destroy any copy of this 
message

___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Problem to add a broadband connection on NetworkManagerUserSettings

2010-01-15 Thread Maxwell Chiareli Xandeco

Sorry . it's automatically added by server, it's not my fault. =(

On Wed, 2010-01-13 at 12:58 -0500, Bill C Riemers wrote:

> On 13/01/10 10:33 AM, Maxwell Chiareli Xandeco wrote: 
> 
> > 
> > Legal Disclaimer: The information contained in this message may be
> > privileged and confidential. It is intended to be read only by the
> > individual or entity to whom it is addressed or by their designee.
> > If the reader of this message is not the intended recipient, you are
> > on notice that any distribution of this message, in any form, is
> > strictly prohibited. If you have received this message in error,
> > please immediately notify the sender and delete or destroy any copy
> > of this message
> 
> Interesting disclaimer for a message sent to a mailing list.   Last I
> checked the sole purpose of a mailing list is to distribute messages.
> 
> 


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Problem to add a broadband connection on NetworkManagerUserSettings

2010-01-13 Thread Maxwell Chiareli Xandeco

I'm using Ubuntu 9.10, with your code I don't get errors but a
connection is not added, nothing happens when I call AddConnection
method.

Follow my policy file:

http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd";>
























512


On Wed, 2010-01-13 at 14:07 +0100, Jirka Klimes wrote:

> On Tuesday 12 January 2010 16:36:07 Maxwell Chiareli Xandeco wrote:
> > Hi all,
> >
> > I trying to add a new broadband connection using dbus python API:
> >
> > settings = dbus.Dictionary({dbus.String(u'connection'):
> > dbus.Dictionary({dbus.String(u'timestamp'): dbus.UInt64(1263301788L,
> > variant_level=1), dbus.String(u'autoconnect'): dbus.Boolean(False,
> > variant_level=1), dbus.String(u'type'): dbus.String(u'gsm',
> > variant_level=1), dbus.String(u'uuid'):
> > dbus.String(u'8a0e02d9-9b1a-463b-a089-7a68140bf4c3', variant_level=1),
> > dbus.String(u'id'): dbus.String(u'Vivo Default', variant_level=1)},
> > signature=dbus.Signature('sv')), dbus.String(u'ppp'):
> > dbus.Dictionary({}, signature=dbus.Signature('sv')),
> > dbus.String(u'gsm'): dbus.Dictionary({dbus.String(u'username'):
> > dbus.String(u'vivo', variant_level=1), dbus.String(u'band'):
> > dbus.Int32(0, variant_level=1), dbus.String(u'apn'):
> > dbus.String(u'zap.vivo.com.br', variant_level=1),
> > dbus.String(u'number'): dbus.String(u'*99#', variant_level=1)},
> > signature=dbus.Signature('sv')), dbus.String(u'serial'):
> > dbus.Dictionary({dbus.String(u'baud'): dbus.UInt32(115200L,
> > variant_level=1)}, signature=dbus.Signature('sv'))},
> > signature=dbus.Signature('sa{sv}'))
> >
> > sys_bus = dbus.SystemBus()
> > proxy = sys_bus.get_object("org.freedesktop.NetworkManagerUserSettings",
> > "/org/freedesktop/NetworkManagerSettings")
> > proxy.AddConnection(settings)
> >
> > When I run this code i get a access denied error:
> >
> > dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied:
> > Rejected send message, 2 matched rules; type="method_call",
> > sender=":1.210" (uid=0 pid=27292 comm="python) interface="(unset)"
> > member="AddConnection" error name="(unset)" requested_reply=0
> > destination=":1.106" (uid=1000 pid=10148 comm="nm-applet))
> >
> > Does someone have any idea?
> >
> > Maxwell
> >
>
> The error says that you don't have permissions.
> It's caused by not specifying interface which the method AddConnection should
> be called on.
>
> so do:
> sys_bus = dbus.SystemBus()
> proxy = sys_bus.get_object("org.freedesktop.NetworkManagerUserSettings",
> "/org/freedesktop/NetworkManagerSettings")
> iface = dbus.Interface(proxy, "org.freedesktop.NetworkManagerSettings")
>
> iface.AddConnection(settings)
>
> Btw, what distribution do you use and what policies do you have in
> /etc/dbus-1/system.d/nm-applet.conf ?
>
> Jirka



 
Legal Disclaimer:
The information contained in this message may be privileged and confidential. 
It is intended to be read only by the individual or entity to whom it is 
addressed or by their designee. If the reader of this message is not the 
intended recipient, you are on notice that any distribution of this message, in 
any form, is strictly prohibited. If you have received this message in error, 
please immediately notify the sender and delete or destroy any copy of this 
message

___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Problem to add a broadband connection on NetworkManagerUserSettings

2010-01-12 Thread Maxwell Chiareli Xandeco
Hi all,

I trying to add a new broadband connection using dbus python API:

settings = dbus.Dictionary({dbus.String(u'connection'):
dbus.Dictionary({dbus.String(u'timestamp'): dbus.UInt64(1263301788L,
variant_level=1), dbus.String(u'autoconnect'): dbus.Boolean(False,
variant_level=1), dbus.String(u'type'): dbus.String(u'gsm',
variant_level=1), dbus.String(u'uuid'):
dbus.String(u'8a0e02d9-9b1a-463b-a089-7a68140bf4c3', variant_level=1),
dbus.String(u'id'): dbus.String(u'Vivo Default', variant_level=1)},
signature=dbus.Signature('sv')), dbus.String(u'ppp'):
dbus.Dictionary({}, signature=dbus.Signature('sv')),
dbus.String(u'gsm'): dbus.Dictionary({dbus.String(u'username'):
dbus.String(u'vivo', variant_level=1), dbus.String(u'band'):
dbus.Int32(0, variant_level=1), dbus.String(u'apn'):
dbus.String(u'zap.vivo.com.br', variant_level=1),
dbus.String(u'number'): dbus.String(u'*99#', variant_level=1)},
signature=dbus.Signature('sv')), dbus.String(u'serial'):
dbus.Dictionary({dbus.String(u'baud'): dbus.UInt32(115200L,
variant_level=1)}, signature=dbus.Signature('sv'))},
signature=dbus.Signature('sa{sv}'))

sys_bus = dbus.SystemBus()
proxy = sys_bus.get_object("org.freedesktop.NetworkManagerUserSettings",
"/org/freedesktop/NetworkManagerSettings")
proxy.AddConnection(settings)

When I run this code i get a access denied error:

dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied:
Rejected send message, 2 matched rules; type="method_call",
sender=":1.210" (uid=0 pid=27292 comm="python) interface="(unset)"
member="AddConnection" error name="(unset)" requested_reply=0
destination=":1.106" (uid=1000 pid=10148 comm="nm-applet))

Does someone have any idea?

Maxwell

 
Legal Disclaimer:
The information contained in this message may be privileged and confidential. 
It is intended to be read only by the individual or entity to whom it is 
addressed or by their designee. If the reader of this message is not the 
intended recipient, you are on notice that any distribution of this message, in 
any form, is strictly prohibited. If you have received this message in error, 
please immediately notify the sender and delete or destroy any copy of this 
message

___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Writing a script to multiple versions of DBus API

2009-12-08 Thread Maxwell Chiareli Xandeco
Hi all,

I'm writing a simple python script to manage a broadband connection.

I'm using the Disconnect() method from Device interface to close
connection, that works fine with the 0.8 version, and on the 0.7 version
I need to use the DeactivateConnection ( o: active_connection ) method
from NetworkManager interface.

My question is, what is the best approach to verify API version and call
the correct method.

Cheers
Maxwell

 
Legal Disclaimer:
The information contained in this message may be privileged and confidential. 
It is intended to be read only by the individual or entity to whom it is 
addressed or by their designee. If the reader of this message is not the 
intended recipient, you are on notice that any distribution of this message, in 
any form, is strictly prohibited. If you have received this message in error, 
please immediately notify the sender and delete or destroy any copy of this 
message

___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list