Bug 816617 - When "Show all problems" is enabled PolicyKit keeps asking for password
Summary: When "Show all problems" is enabled PolicyKit keeps asking for password
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: abrt
Version: 17
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: abrt
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-26 14:07 UTC by Michal Nowak
Modified: 2013-08-01 16:22 UTC (History)
12 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-08-01 16:22:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Michal Nowak 2012-04-26 14:07:00 UTC
Description of problem:

When "Show all problems" is enabled in ABRT GUI PolicyKit (?) keeps asking for password every five minutes.

Version-Release number of selected component (if applicable):

abrt-2.0.10-1.fc17

Expected results:

Asks once.

Comment 1 Jiri Moskovcak 2012-08-09 21:55:50 UTC
This seems to me more like a problem (or feature??) in policykit. In abrt policy we have: 

<allow_active>auth_admin_keep</allow_active>

- which should mean that policykit doesn't drop the authentication

Comment 2 David Zeuthen 2012-08-20 16:09:17 UTC
This is not a polkit problem - it's abrt using the polkit APIs incorrectly. See

 http://www.freedesktop.org/software/polkit/docs/latest/polkit-apps.html

for best practices. Reassigning back.

Comment 3 Jakub Filak 2012-08-20 17:02:34 UTC
(In reply to comment #2)
> This is not a polkit problem - it's abrt using the polkit APIs incorrectly.
> See
> 
>  http://www.freedesktop.org/software/polkit/docs/latest/polkit-apps.html
> 
> for best practices. Reassigning back.

Thank you for your advice.

I bet, that the following citation means that we have to keep an authorization on our side. Am I right? 

"auth_admin_keep - Like auth_admin but the authorization is kept for a brief period (e.g. five minutes)."
[http://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html]

Because there is no way how to extend the brief period. As we can is in the following citation.

"/* TODO: right now the time the temporary authorization is kept is hard-coded - we
   *       could make it a propery on the PolkitBackendInteractiveAuthority class (so
   *       the local authority could read it from a config file) or a vfunc
   *       (so the local authority could read it from an annotation on the action).
   */
  expiration_seconds = 5 * 60;"
[http://cgit.freedesktop.org/polkit/tree/src/polkitbackend/polkitbackendinteractiveauthority.c#n3100]

Comment 4 David Zeuthen 2012-08-20 17:15:41 UTC
I don't know how your program works but it sounds like you are calling CheckAuthorization() with the flag ALLOW_USER_INTERACTION even when not in response to user action (e.g. user action = user pressing a button or similar). The docs says not to do this, see

 http://www.freedesktop.org/software/polkit/docs/latest/eggdbus-interface-org.freedesktop.PolicyKit1.Authority.html#eggdbus-method-org.freedesktop.PolicyKit1.Authority.CheckAuthorization

precisely to avoid problems like this.

I guess you do this because your setup is that your GUI calls a method on your daemon from time to time and the daemon implementation calls polkit's CheckAuthorization() method. Right?

I would propose a different architecture, for example

 - your daemon automatically does its thing on a regular schedule (without
   checking for authorization). The GUI then piggy-backs on this info
   and no authorization is needed

 - you could have the GUI establish a "session" with your daemon and this
   session "remembers" the authorization ... I guess that's what you meant
   with "I bet, that the following citation means that we have to keep an
   authorization on our side."

 - consider if you need to check with polkit at all - maybe the operation
   isn't privileged at all

Remember the best GUI is a GUI that doesn't interrupt the user with unneeded password dialogs (sometimes that isn't possible, of course, but sometimes it is).

Comment 5 Jiri Moskovcak 2012-08-21 06:55:35 UTC
(In reply to comment #4)
> I don't know how your program works but it sounds like you are calling
> CheckAuthorization() with the flag ALLOW_USER_INTERACTION even when not in
> response to user action (e.g. user action = user pressing a button or
> similar). The docs says not to do this, see
> 

- it's actually called on user action

>  http://www.freedesktop.org/software/polkit/docs/latest/eggdbus-interface-
> org.freedesktop.PolicyKit1.Authority.html#eggdbus-method-org.freedesktop.
> PolicyKit1.Authority.CheckAuthorization
> 
> precisely to avoid problems like this.
> 
> I guess you do this because your setup is that your GUI calls a method on
> your daemon from time to time and the daemon implementation calls polkit's
> CheckAuthorization() method. Right?

- not from time to time, but when user cliks on a specific button

> 
> I would propose a different architecture, for example
> 
>  - your daemon automatically does its thing on a regular schedule (without
>    checking for authorization). The GUI then piggy-backs on this info
>    and no authorization is needed
> 
>  - you could have the GUI establish a "session" with your daemon and this
>    session "remembers" the authorization ... I guess that's what you meant
>    with "I bet, that the following citation means that we have to keep an
>    authorization on our side."

- think this is something that many programs could use, so I would expect it in polkit so we have one proper implementation of such "session"

> 
>  - consider if you need to check with polkit at all - maybe the operation
>    isn't privileged at all
> 

- unfortunatelly we need it, there is a button in the GUI which is supposed to show data from various crashes from all users which I believe should require root password

> Remember the best GUI is a GUI that doesn't interrupt the user with unneeded
> password dialogs (sometimes that isn't possible, of course, but sometimes it
> is).

Comment 7 Fedora End Of Life 2013-07-04 05:21:10 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Fedora End Of Life 2013-08-01 16:22:54 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.