[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Freeipa-devel] [PATCH] 0346 permission_find: Do not fail for ipasearchrecordslimit=-1



Hello,
Honza found a failure in the new permission plugin when ipasearchrecordslimit is set to -1. Here is a fix.

--
PetrĀ³
From 202b366e09ef9f5f9ed357640f28d6fe787c55af Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pviktori redhat com>
Date: Mon, 16 Dec 2013 16:11:33 +0100
Subject: [PATCH] permission_find: Do not fail for ipasearchrecordslimit=-1

ipasearchrecordslimit can be -1, which means unlimited.
The permission_find post_callback failed in this case in legacy
permission handling.
Do not fail in this case.
---
 ipalib/plugins/permission.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipalib/plugins/permission.py b/ipalib/plugins/permission.py
index 345faa896c942007f0ab58fb03dbe769c700ce08..2570c2bd15ee81da874f746293a7ce5f4c04591c 100644
--- a/ipalib/plugins/permission.py
+++ b/ipalib/plugins/permission.py
@@ -891,7 +891,7 @@ def post_callback(self, ldap, entries, truncated, *args, **options):
             for entry in legacy_entries:
                 if entry.single_value['cn'] in nonlegacy_names:
                     continue
-                if len(entries) > max_entries:
+                if entries and len(entries) > max_entries:
                     # We've over the limit, pop the last entry and set
                     # truncated flag
                     # (this is easier to do than checking before adding
-- 
1.8.3.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]