Bug 14600 - ObtainAuthorization() returns 0 if already authorized.
Summary: ObtainAuthorization() returns 0 if already authorized.
Status: RESOLVED INVALID
Alias: None
Product: PolicyKit
Classification: Unclassified
Component: libpolkit (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact: David Zeuthen (not reading bugmail)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-21 02:59 UTC by Murray Cumming
Modified: 2009-10-21 10:32 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Murray Cumming 2008-02-21 02:59:11 UTC
ObtainAuthorization() seems to return 0 if either
- authorization was not allowed.
- authorization was previously given.

So we must use IsProcessAuthorized() first to really know. This is annoying - it would be simpler if we could just call ObtainAuthorization().
Comment 1 David Zeuthen (not reading bugmail) 2008-02-21 07:45:13 UTC
(In reply to comment #0)
> ObtainAuthorization() seems to return 0 if either
> - authorization was not allowed.
> - authorization was previously given.
> 
> So we must use IsProcessAuthorized() first to really know. This is annoying -
> it would be simpler if we could just call ObtainAuthorization().

The preferred way to deal with this from a GTK+ application is simply to use PolicyKit-gnome. Then all this crap happens without you knowing and you get subtle hints such as padlock icons and making unobtainable actions insensitive.
 
Why are you not just using PolicyKit-gnome? Anyway, I don't think there's any bug here... feel free to reopen if you disagree. Thanks.


Comment 2 Murray Cumming 2008-02-21 09:24:34 UTC
> Why are you not just using PolicyKit-gnome?

I'm using Python, and someone (I think you, but maybe I'm wrong) recommended that I use the D-Bus API directly.

> Anyway, I don't think there's any bug here... feel free to reopen if you disagree. Thanks.

It seems worthwhile for the D-Bus API to act sensibly, or at least be documented, explaining why it works as it does. If it's private and shouldn't be used then by applications ever then that could be documented instead.

Comment 3 Murray Cumming 2008-04-25 06:38:46 UTC
Don't you agree that it seems wrong for ObtainAuthorization() to just return 0 if authorization was already given?
Comment 4 David Zeuthen (not reading bugmail) 2009-10-21 10:32:41 UTC
This bug report is for the old version of PolicyKit. Closing as all of the code has been rewritten. Please reopen if the bug report applies to the latest version of PolicyKit. Thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.