Expand documentation of Persistence attribute

Authored by elvisangelaccio on Jun 17 2017, 1:11 PM.



Add a note that the 'session' and 'always' values are meaningless with
the polkit-1 backend, and explain what they actually do.
While at it, also explain what happens when the attribute is not used.

Diff Detail

R283 KAuth
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: Frameworks. · View Herald TranscriptJun 17 2017, 1:11 PM
davidedmundson requested changes to this revision.Jun 18 2017, 6:26 PM
davidedmundson added a subscriber: davidedmundson.

Polkit-1 has the a concept of persistence, under a different name. A policy can be set to:

  • auth_admin
  • auth_admin_keep

policy-gen-polkit1.cpp chooses between these using the persistence flag

if (!action.persistence.isEmpty() && policy != QLatin1String("yes") && policy !=
        QLatin1String("no")) {
    policy += QLatin1String("_keep");

Which is saying if persistence is set to anything and the policy is either "auth" or "auth_self" append "_keep"

Granted that doesn't match the current docs, but WRT D6198 we can delete that persistence attribute and it won't linger.

This revision now requires changes to proceed.Jun 18 2017, 6:26 PM

In policy-gen.cpp there is this condition

if (persistence != QLatin1String("session") && persistence != QLatin1String("always")) {
       qCritical("Wrong persistence: %s", persistence.toLatin1().data());

So, if there is persistence then it can't be just set to anything, it has to be either 'session' or 'always', then only it would append '_keep'.

Right, there's 2 valid options if it's set, session and always. Which as you say behave the same.
and an implicit third option, not setting it at all. Which does have a different behaviour to the above.

I think that needs clearing up in the docs with a line:

" - not set: authorization will be queried every time"

elvisangelaccio edited edge metadata.
  • Explain what happens when the persistence attribute is missing.
elvisangelaccio edited the summary of this revision. (Show Details)Jun 27 2017, 5:11 PM
davidedmundson accepted this revision.Jun 27 2017, 5:14 PM
This revision is now accepted and ready to land.Jun 27 2017, 5:14 PM
This revision was automatically updated to reflect the committed changes.