Serghei Amelian | 20 Jun 2012 19:10
Picon

policykit authentication agent with dbus

Hello,

I want to implement a policy agent for kde3 and I want to use only dbus calls. 
Unfortunately plolicykit dbus API is not very well documented and I cannot 
figure out how to emulate polkit_unix_session_new_for_process_sync().

Any clue?

Thanks.

--

-- 
Serghei
Kevin Chadwick | 20 Jun 2012 20:17
Picon
Favicon

Re: policykit authentication agent with dbus

> I want to implement a policy agent for kde3 and I want to use only dbus calls.

What's so good about dbus. For years Windows has been criticised for
it's abundant use of difficult to secure RPC. (Ever disabled RPC on
Windows?, quite amusing). IPC over usage is worrying. IPC on QNXs
microkernel may add to reliability for driver distancing but it also
adds major security problems and other instabilities.

________________________________________________________

 Why not do something good every day and install BOINC.
________________________________________________________
PCMan | 20 Jun 2012 20:27
Picon

Re: policykit authentication agent with dbus

On Thu, Jun 21, 2012 at 2:17 AM, Kevin Chadwick <ma1l1ists <at> yahoo.co.uk> wrote:
>> I want to implement a policy agent for kde3 and I want to use only dbus calls.
>
> What's so good about dbus. For years Windows has been criticised for
> it's abundant use of difficult to secure RPC. (Ever disabled RPC on
> Windows?, quite amusing). IPC over usage is worrying. IPC on QNXs
> microkernel may add to reliability for driver distancing but it also
> adds major security problems and other instabilities.
>
> ________________________________________________________
>
>  Why not do something good every day and install BOINC.
> ________________________________________________________
> _______________________________________________
> devkit-devel mailing list
> devkit-devel <at> lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/devkit-devel

Looks like it uses ConsoleKit?
org.freedesktop.ConsoleKit
/org/freedesktop/ConsoleKit/Manager
org.freedesktop.ConsoleKit.Manager
GetSessionForUnixProcess

I read its source code and found this.
Serghei Amelian | 20 Jun 2012 20:34
Picon

Re: policykit authentication agent with dbus

On Wednesday 20 June 2012 21:27:02 PCMan wrote:

[...]

> Looks like it uses ConsoleKit?
> org.freedesktop.ConsoleKit
> /org/freedesktop/ConsoleKit/Manager
> org.freedesktop.ConsoleKit.Manager
> GetSessionForUnixProcess
>
> I read its source code and found this.

I think you right, I missed this chunk of code.

Thanks.

--

-- 
Serghei
Serghei Amelian | 20 Jun 2012 22:20
Picon

Re: policykit authentication agent with dbus

On Wednesday 20 June 2012 21:34:19 Serghei Amelian wrote:
> On Wednesday 20 June 2012 21:27:02 PCMan wrote:
>
> [...]
>
> > Looks like it uses ConsoleKit?
> > org.freedesktop.ConsoleKit
> > /org/freedesktop/ConsoleKit/Manager
> > org.freedesktop.ConsoleKit.Manager
> > GetSessionForUnixProcess
> >
> > I read its source code and found this.
>
> I think you right, I missed this chunk of code.
>
> Thanks.

I used org.freedesktop.ConsoleKit.Manager.GetCurrentSession, which returns an 
object path like "/org/freedesktop/ConsoleKit/Session2".

In PolicyKit is stated: "Unix Session. subject_kind should be set to 
unix-session with the key session-id (of type string)".

But i'm not sure what "session-id" is, because if I pass to 
RegisterAuthenticationAgent the object path returned by GetCurrentSession it 
returns this error: "Passed session and the session the caller is in differs. 
They must be equal for now."

--

-- 
Serghei
(Continue reading)

Serghei Amelian | 24 Jun 2012 10:30
Picon

Re: policykit authentication agent with dbus

On Wednesday 20 June 2012 23:20:31 Serghei Amelian wrote:
> On Wednesday 20 June 2012 21:34:19 Serghei Amelian wrote:
> > On Wednesday 20 June 2012 21:27:02 PCMan wrote:
> >
> > [...]
> >
> > > Looks like it uses ConsoleKit?
> > > org.freedesktop.ConsoleKit
> > > /org/freedesktop/ConsoleKit/Manager
> > > org.freedesktop.ConsoleKit.Manager
> > > GetSessionForUnixProcess
> > >
> > > I read its source code and found this.
> >
> > I think you right, I missed this chunk of code.
> >
> > Thanks.
>
> I used org.freedesktop.ConsoleKit.Manager.GetCurrentSession, which returns
> an object path like "/org/freedesktop/ConsoleKit/Session2".
>
> In PolicyKit is stated: "Unix Session. subject_kind should be set to
> unix-session with the key session-id (of type string)".
>
> But i'm not sure what "session-id" is, because if I pass to
> RegisterAuthenticationAgent the object path returned by GetCurrentSession
> it returns this error: "Passed session and the session the caller is in
> differs. They must be equal for now."

Any idea how to extract session ID 
(Continue reading)


Gmane