FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 05-05-2008, 02:31 PM
"S.Çağlar Onur"
 
Default Use org.freedesktop.PolicyKit.AuthenticationAgent for PolicyKit

Hi;

Following patch replaces deprecated "ShowDialog" method with "ObtainAuthorization" one and also changes desktop dependent "org.gnome.PolicyKit" interface with "org.freedesktop.PolicyKit.AuthenticationAgent " one to permit other PolicyKit Authentication Agents (like PolicyKit-KDE).

Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr>

diff -r 5142197392f2 src/virtManager/connection.py
--- a/src/virtManager/connection.py Fri May 02 09:36:36 2008 -0400
+++ b/src/virtManager/connection.py Mon May 05 17:21:05 2008 +0300
@@ -339,9 +339,9 @@
def _do_creds_polkit(self, action):
logging.debug("Doing policykit for %s" % action)
bus = dbus.SessionBus()
- obj = bus.get_object("org.gnome.PolicyKit", "/org/gnome/PolicyKit/Manager")
- pkit = dbus.Interface(obj, "org.gnome.PolicyKit.Manager")
- pkit.ShowDialog(action, 0)
+ obj = bus.get_object("org.freedesktop.PolicyKit.Authenti cationAgent", "/")
+ pkit = dbus.Interface(obj, "org.freedesktop.PolicyKit.AuthenticationAgent ")
+ pkit.ObtainAuthorization(action, 0, os.getpid())
return 0

def _do_creds_dialog(self, creds):

Cheers
--
S.Çağlar Onur <caglar@pardus.org.tr>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 05-05-2008, 07:54 PM
"Daniel P. Berrange"
 
Default Use org.freedesktop.PolicyKit.AuthenticationAgent for PolicyKit

On Mon, May 05, 2008 at 05:31:50PM +0300, S.?a??lar Onur wrote:
> Hi;
>
> Following patch replaces deprecated "ShowDialog" method with
> "ObtainAuthorization" one and also changes desktop dependent
> "org.gnome.PolicyKit" interface with
> "org.freedesktop.PolicyKit.AuthenticationAgent " one to permit
> other PolicyKit Authentication Agents (like PolicyKit-KDE).
>
> Signed-off-by: S.a??lar Onur <caglar@pardus.org.tr>

I'm fine with this in principle, however, it needs to fallback to looking
for "org.gnome.PolicyKit" if "org.freedesktop.PolicyKit.AuthenticationAgent "
is not found, because the latter was only introduced in version 0.7 of
PolicyKit

Regards,
Daniel
--
|: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 05-05-2008, 07:57 PM
"S.Çağlar Onur"
 
Default Use org.freedesktop.PolicyKit.AuthenticationAgent for PolicyKit

Hi;

05 May 2008 Pts tarihinde, Daniel P. Berrange şunları yazmıştı:
> I'm fine with this in principle, however, it needs to fallback to looking
> for "org.gnome.PolicyKit" if "org.freedesktop.PolicyKit.AuthenticationAgent "
> is not found, because the latter was only introduced in version 0.7 of
> PolicyKit

Fair enough , i'll update the patch with fallback and will re-send...

> Regards,
> Daniel

Cheers
--
S.Çağlar Onur <caglar@pardus.org.tr>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 05-05-2008, 08:24 PM
"S.Çağlar Onur"
 
Default Use org.freedesktop.PolicyKit.AuthenticationAgent for PolicyKit

05 May 2008 Pts tarihinde, S.Çağlar Onur şunları yazmıştı:
> 05 May 2008 Pts tarihinde, Daniel P. Berrange şunları yazmıştı:
> > I'm fine with this in principle, however, it needs to fallback to looking
> > for "org.gnome.PolicyKit" if "org.freedesktop.PolicyKit.AuthenticationAgent "
> > is not found, because the latter was only introduced in version 0.7 of
> > PolicyKit
>
> Fair enough , i'll update the patch with fallback and will re-send...

Following patch introduce usage of "org.freedesktop.PolicyKit.AuthenticationAgent " interface of PolicyKit to permit other PolicyKit Authentication Agents (like PolicyKit-KDE). If virt-manager runs with PolicyKit which not provides that interface, it fallbacks to old one as suggested by Daniel P. Berrange.

Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr>

diff -r 5142197392f2 src/virtManager/connection.py
--- a/src/virtManager/connection.py Fri May 02 09:36:36 2008 -0400
+++ b/src/virtManager/connection.py Mon May 05 23:19:25 2008 +0300
@@ -339,9 +339,17 @@
def _do_creds_polkit(self, action):
logging.debug("Doing policykit for %s" % action)
bus = dbus.SessionBus()
- obj = bus.get_object("org.gnome.PolicyKit", "/org/gnome/PolicyKit/Manager")
- pkit = dbus.Interface(obj, "org.gnome.PolicyKit.Manager")
- pkit.ShowDialog(action, 0)
+
+ try:
+ # First try to use org.freedesktop.PolicyKit.AuthenticationAgent which is introduced with PolicyKit-0.7
+ obj = bus.get_object("org.freedesktop.PolicyKit.Authenti cationAgent", "/")
+ pkit = dbus.Interface(obj, "org.freedesktop.PolicyKit.AuthenticationAgent ")
+ pkit.ObtainAuthorization(action, 0, os.getpid())
+ except org.freedesktop.DBus.Error.ServiceUnknown:
+ # If PolicyKit < 0.7, fallback to org.gnome.PolicyKit
+ obj = bus.get_object("org.gnome.PolicyKit", "/org/gnome/PolicyKit/Manager")
+ pkit = dbus.Interface(obj, "org.gnome.PolicyKit.Manager")
+ pkit.ShowDialog(action, 0)
return 0

def _do_creds_dialog(self, creds):


Cheers
--
S.Çağlar Onur <caglar@pardus.org.tr>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 05-05-2008, 11:38 PM
"Daniel P. Berrange"
 
Default Use org.freedesktop.PolicyKit.AuthenticationAgent for PolicyKit

On Mon, May 05, 2008 at 11:24:40PM +0300, S.?a??lar Onur wrote:
> 05 May 2008 Pts tarihinde, S.a??lar Onur ??unlar?? yazm????t??:
> > 05 May 2008 Pts tarihinde, Daniel P. Berrange ??unlar?? yazm????t??:
> > > I'm fine with this in principle, however, it needs to fallback to looking
> > > for "org.gnome.PolicyKit" if "org.freedesktop.PolicyKit.AuthenticationAgent "
> > > is not found, because the latter was only introduced in version 0.7 of
> > > PolicyKit
> >
> > Fair enough , i'll update the patch with fallback and will re-send...
>
> Following patch introduce usage of "org.freedesktop.PolicyKit.AuthenticationAgent "
> interface of PolicyKit to permit other PolicyKit Authentication Agents (like 5B
> PolicyKit-KDE). If virt-manager runs with PolicyKit which not provides that
> interface, it fallbacks to old one as suggested by Daniel P. Berrange.
>
> Signed-off-by: S.a??lar Onur <caglar@pardus.org.tr>

Thanks, I have committed this patch to the repo

Regards,
Daniel
--
|: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 

Thread Tools




All times are GMT. The time now is 10:21 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org