[Freeipa-devel] [PATCH] krbcache setting fixes

Kevin McCarthy kmccarth at redhat.com
Thu Sep 20 21:54:29 UTC 2007


This patch is to add the set_krbcache() calls to the new methods in
controller I added.

The patch is untested - I'm still having troubles with krb ticket
issues.

-Kevin

-------------- next part --------------
# HG changeset patch
# User Kevin McCarthy <kmccarth at redhat.com>
# Date 1190325203 25200
# Node ID 62a1ecb5573f42faa4453b094678abc6a784c2b5
# Parent  e0c187057e32e2e58510023e427f5a615ab17539
Add set_krbccache() calls to new controller methods.
Small fix to proxyprovider for anonymous case.

diff -r e0c187057e32 -r 62a1ecb5573f ipa-server/ipa-gui/ipagui/controllers.py
--- a/ipa-server/ipa-gui/ipagui/controllers.py	Thu Sep 20 16:58:54 2007 -0400
+++ b/ipa-server/ipa-gui/ipagui/controllers.py	Thu Sep 20 14:53:23 2007 -0700
@@ -228,7 +228,7 @@ class Root(controllers.RootController):
     def userlist_ajax(self, **kw):
         """Searches for users and displays list of results in a table.
            This method is used for ajax calls."""
-        client.set_principal(identity.current.user_name)
+        client.set_krbccache(os.environ["KRB5CCNAME"])
         users = []
         searchlimit = 100
         uid = kw.get('uid')
@@ -332,7 +332,7 @@ class Root(controllers.RootController):
         if (len(givenname) == 0) or (len(sn) == 0):
             return ""
 
-        client.set_principal(identity.current.user_name)
+        client.set_krbccache(os.environ["KRB5CCNAME"])
         givenname = givenname.lower()
         sn = sn.lower()
 
@@ -384,7 +384,7 @@ class Root(controllers.RootController):
         if tg_errors:
             turbogears.flash("There was a problem with the form!")
 
-        client.set_principal(identity.current.user_name)
+        client.set_krbccache(os.environ["KRB5CCNAME"])
 
         return dict(form=group_new_form)
 
@@ -393,7 +393,7 @@ class Root(controllers.RootController):
     def groupcreate(self, **kw):
         """Creates a new group"""
         restrict_post()
-        client.set_principal(identity.current.user_name)
+        client.set_krbccache(os.environ["KRB5CCNAME"])
 
         if kw.get('submit') == 'Cancel':
             turbogears.flash("Add group cancelled")
@@ -427,7 +427,7 @@ class Root(controllers.RootController):
         if tg_errors:
             turbogears.flash("There was a problem with the form!")
 
-        client.set_principal(identity.current.user_name)
+        client.set_krbccache(os.environ["KRB5CCNAME"])
         try:
             group = client.get_group_by_cn(cn, group_fields)
 
@@ -470,7 +470,7 @@ class Root(controllers.RootController):
     def groupupdate(self, **kw):
         """Updates an existing group"""
         restrict_post()
-        client.set_principal(identity.current.user_name)
+        client.set_krbccache(os.environ["KRB5CCNAME"])
         if kw.get('submit') == 'Cancel Edit':
             turbogears.flash("Edit group cancelled")
             raise turbogears.redirect('/groupshow', cn=kw.get('cn'))
@@ -573,7 +573,7 @@ class Root(controllers.RootController):
     @identity.require(identity.not_anonymous())
     def grouplist(self, **kw):
         """Search for groups and display results"""
-        client.set_principal(identity.current.user_name)
+        client.set_krbccache(os.environ["KRB5CCNAME"])
         groups = None
         # counter = 0
         criteria = kw.get('criteria')
@@ -595,7 +595,7 @@ class Root(controllers.RootController):
     @identity.require(identity.not_anonymous())
     def groupshow(self, cn):
         """Retrieve a single group for display"""
-        client.set_principal(identity.current.user_name)
+        client.set_krbccache(os.environ["KRB5CCNAME"])
         try:
             group = client.get_group_by_cn(cn, group_fields)
             group_dict = group.toDict()
diff -r e0c187057e32 -r 62a1ecb5573f ipa-server/ipa-gui/ipagui/proxyprovider.py
--- a/ipa-server/ipa-gui/ipagui/proxyprovider.py	Thu Sep 20 16:58:54 2007 -0400
+++ b/ipa-server/ipa-gui/ipagui/proxyprovider.py	Thu Sep 20 14:53:23 2007 -0700
@@ -19,8 +19,7 @@ class IPA_User(object):
 
 class ProxyIdentity(object):
     def __init__(self, visit_key, user=None):
-        if user:
-            self._user= user
+        self._user= user
         self.visit_key= visit_key
    
     def _get_user(self):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2228 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20070920/5de6280b/attachment.bin>


More information about the Freeipa-devel mailing list