[Gambas-user] Dbus unique name seems incorrect

Benoît Minisini g4mba5 at gmail.com
Thu Jan 20 12:44:07 CET 2022


Le 16/01/2022 à 23:26, Brian G a écrit :
> Hi Benoît,
> 
>    When working with the policykit1, some of the methods require a unique name. By the DBus standard a unique name must start with a colon. Normally the Hello method would return a unique id, but that crashes when I try to us it.
> 
> When I try to pass the dbus name to the Kit I get an invalid name error. Upon research the name must start with a : to be unique.
> 
> When working with the PolicyKit1:
> 
>    Dim Proxy As New DBusProxy(App, "/org/freedesktop/PolicyKit1/Authority", "org.freedesktop.PolicyKit1.Authority")
>    Dim System_Bus_Name As String = DBus.name
>    Dim subject As Variant = ["system-bus-name", ["name": System_Bus_Name]]
>    Dim action_id As String = "org.freedesktop.policykit.exec"
>    Dim Details As Variant = New Collection
>    Dim flags As Integer = 1
>    Dim cancellation_id As String = ""
>    Dim sresult As Variant = Proxy.CheckAuthorization(subject, action_id, details, flags, cancellation_id)
>              org.freedesktop.PolicyKit1.Error.Failed:Error getting subject: Error Parsing system-bus-name subject: 'org.gambas.Auth-537384' is not a unique name.
> 
>    Would it be possible to change how the naming works?
> 
> "Failure is the key to success;
>   each mistake teaches us something"  .. Morihei Ueshiba
> Brian G
> 

I didn't see that in the D-Bus documentation. Either I missed it, either 
it's a PolicyKit thing.

-- 
Benoît Minisini


More information about the User mailing list