A fix for https://fedorahosted.org/freeipa/ticket/4359

--
PetrĀ³
From 9463adb3ea459aa0d0a8c47d0c6d87989426d064 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Tue, 8 Jul 2014 15:22:23 +0200
Subject: [PATCH] baseldap: Return empty string when no effective rights are
 found

DS returns the string "none" when no rights were found. All clients
would need to special-case this value when checking the rights.
Return empty string instead.

https://fedorahosted.org/freeipa/ticket/4359
---
 ipalib/plugins/baseldap.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 44302c9a7eb3eefeb20fe741938498b99fd70fed..e5a23b99f48f47558937d821c6bbaba94a5707dc 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -210,6 +210,10 @@ def get_effective_rights(ldap, dn, attrs=None):
         rights = rights[0].split(', ')
         for r in rights:
             (k,v) = r.split(':')
+            if v == 'none':
+                # the string "none" means "no rights found"
+                # see https://fedorahosted.org/freeipa/ticket/4359
+                v = ''
             rdict[k.strip().lower()] = v
 
     return rdict
-- 
1.9.3

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to