Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 591046 - Wrong handling non-authorized method result with python-slip-polkit
Summary: Wrong handling non-authorized method result with python-slip-polkit
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: python-slip
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Nils Philippsen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-11 10:11 UTC by Radek Novacek
Modified: 2016-12-01 00:29 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-10 11:28:08 UTC


Attachments (Terms of Use)
Possible solution for the issue (deleted)
2010-05-11 10:11 UTC, Radek Novacek
no flags Details | Diff
Patch that is aware of returning tuples (deleted)
2010-05-14 15:32 UTC, Radek Novacek
no flags Details | Diff
Patch for slip dbus (deleted)
2010-05-28 09:09 UTC, Radek Novacek
no flags Details | Diff

Description Radek Novacek 2010-05-11 10:11:17 UTC
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 15:32:53 UTC
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 16:01:32 UTC
Just returned from vacation. Are you using sync or async dbus methods?

Comment 3 Radek Novacek 2010-05-27 07:42:31 UTC
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 09:09:02 UTC
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 09:13:40 UTC
Ping, any progress?

Comment 6 Bug Zapper 2010-11-03 15:07:14 UTC
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 15:25:05 UTC
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 13:53:00 UTC
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.