Lock Down

David Zeuthen david at fubar.dk
Fri Sep 18 08:38:46 PDT 2009


On Mon, 2009-09-14 at 20:46 +0100, James Westby wrote:
> On Sat Sep 12 22:20:01 +0100 2009 David Zeuthen wrote:
> > this patch or if it's compatible with how PackageKit works. And maybe if
> > Richard wants to do the UI in a different way (say, a checkbox in a
> > preference dialog) he can do just that by invoking pklalockdown(1)
> > himself.
> 
> It seems to me that this part is a little odd.
> 
> What happens if this is used on a system that uses a different backend?
> You will have something in the UI that pokes at a backend not in use,
> so you will get something that doesn't do what it says. If you want
> to encourage other apps to make use of this then isn't it something
> that should be abstracted such that they don't call something
> backend-specific?

Yeah, I think what we want instead is

 1. Some way for apps to get informed about the backend and the features
    it supports

 2. AddLockdownForAction() and RemoveLockdownForAction() methods

 3. Then remove pklalockdown(1) and port e.g. PolkitLockButton to use
    this new API

I've already done the first step, see

http://cgit.freedesktop.org/PolicyKit/commit/?id=49de132d4ed313926f7e7f92da22cd6a3e50da18

that adds properties

 BackendName (string)
 BackendVersion (string)
 BackendFeatures (uint32)

where the latter is a set of flags from this enumeration

 POLKIT_AUTHORITY_FEATURES_NONE = 0,
 POLKIT_AUTHORITY_FEATURES_TEMPORARY_AUTHORIZATION = (1<<0),
 POLKIT_AUTHORITY_FEATURES_LOCKDOWN = (1<<1)

to the Authority object. This is also going to be useful if we want to
add new API later. I'll do the rest soon and then I'll roll a release.

Thanks,
David




More information about the polkit-devel mailing list