Bug 591046 - Wrong handling non-authorized method result with python-slip-polkit
Wrong handling non-authorized method result with python-slip-polkit
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: python-slip (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Nils Philippsen
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-11 06:11 EDT by Radek Novacek
Modified: 2016-11-30 19:29 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-01-10 06:28:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Possible solution for the issue (634 bytes, patch)
2010-05-11 06:11 EDT, Radek Novacek
no flags Details | Diff
Patch that is aware of returning tuples (733 bytes, patch)
2010-05-14 11:32 EDT, Radek Novacek
no flags Details | Diff
Patch for slip dbus (968 bytes, patch)
2010-05-28 05:09 EDT, Radek Novacek
no flags Details | Diff

  None (edit)
Description Radek Novacek 2010-05-11 06:11:17 EDT
Created attachment 413083 [details]
Possible solution for the issue

When I create a subclass of slip.dbus.service.Object, that provides some dbus methods without polkit authorization, this methods don't return value through dbus to the sender. Methods with polkit authorization is working as expected.

I might also figured out a solution, please see attached patch.

Versions:
python-slip-0.2.9-1.fc12.noarch
python-slip-dbus-0.2.9-1.fc12.noarch
Comment 1 Radek Novacek 2010-05-14 11:32:53 EDT
Created attachment 414089 [details]
Patch that is aware of returning tuples

The previous patch didn't work when a tuple was returned, this patch should work better.
Comment 2 Nils Philippsen 2010-05-26 12:01:32 EDT
Just returned from vacation. Are you using sync or async dbus methods?
Comment 3 Radek Novacek 2010-05-27 03:42:31 EDT
I'm using sync methods. Strange thing is that example from slip works, but my code doesn't. If you want to try it, the error occurs when I try to call some methods from FMCI interface [ https://fedorahosted.org/fmci/wiki ].
Comment 4 Radek Novacek 2010-05-28 05:09:02 EDT
Created attachment 417526 [details]
Patch for slip dbus

I have found another issue in python-slip code when I used python introspection. It eats some properties of method when the method is dbus interface. Try to run this code from directory with python-slip example:

import imp
server = imp.load_source("server", "example-conf-mechanism.py")
o = server.ExampleObject ()
o.read._slip_polkit_auth_required

The patch should correct the behavior. Now it chokes most parameters including __doc__, _slip_polkit_auth_required etc.
Comment 5 Radek Novacek 2010-07-02 05:13:40 EDT
Ping, any progress?
Comment 6 Bug Zapper 2010-11-03 11:07:14 EDT
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  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 '12'.

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 12'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 12 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 please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

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.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 7 Nils Philippsen 2011-06-20 11:25:05 EDT
Argh, completely dropped the ball on this ticket, sorry.

(In reply to comment #4)
> Created attachment 417526 [details]
> Patch for slip dbus

Hmm, I'd rather not simply copy over stuff and hope that catching TypeError, ValueError will even things out ;-). Perhaps using the decorator module to build the decorator more cleanly would help...
 
> I have found another issue in python-slip code when I used python
> introspection. It eats some properties of method when the method is dbus
> interface. Try to run this code from directory with python-slip example:
> 
> import imp
> server = imp.load_source("server", "example-conf-mechanism.py")
> o = server.ExampleObject ()
> o.read._slip_polkit_auth_required
> 
> The patch should correct the behavior. Now it chokes most parameters including
> __doc__, _slip_polkit_auth_required etc.

Ehm, why do you need to access the _slip_polkit_auth_required on the method? This is simply a flag added to the method by the decorator which is then used (and forgotten about) in the metaclass which will wrap the method in the polkit boiler plate code.
Comment 8 Radek Novacek 2012-01-03 08:53:00 EST
Sorry, I completely forgot about this bug. I used that in project that is dead now. So feel free to close this bug.

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