Hello,

Updated patch attached.

- Time limit is -1 for unlimited. I found this
https://www.redhat.com/archives/freeipa-devel/2011-January/msg00330.html in
reference to keeping the time limit as -1 for unlimited.
Sure enough, testing time limit at 0 did not work for unlimited as well as
appeared to have negative effects on IPA. Also, I believe that
http://www.python-ldap.org/doc/html/ldap.html#ldap.LDAPObject.search_ext_s
specifies unlimited for time limit as -1. (Please correct me if I am wrong.)

- Size limit is 0 for unlimited per Jan's comment including a conversion
from -1 to 0 if -1 is entered for unlimited size limit.

>            Actually, 0 means unlimited for size limit, see
>            <
http://www.python-ldap.org/doc/html/ldap.html#ldap.LDAPObject.search_ext_s>

Thanks,

Gabe

On Tue, Aug 4, 2015 at 3:28 AM, Jan Cholasta <jchol...@redhat.com> wrote:

> Dne 31.7.2015 v 17:08 Gabe Alford napsal(a):
>
>> Updated patch attached.
>>
>> Thanks,
>>
>> Gabe
>>
>> On Thu, Jul 30, 2015 at 7:15 AM, Gabe Alford <redhatri...@gmail.com
>> <mailto:redhatri...@gmail.com>> wrote:
>>
>>     On Thu, Jul 30, 2015 at 1:32 AM, Jan Cholasta <jchol...@redhat.com
>>     <mailto:jchol...@redhat.com>> wrote:
>>
>>         Dne 30.7.2015 v 09:23 Jan Cholasta napsal(a):
>>
>>             Hi,
>>
>>             Dne 29.7.2015 v 17:23 Gabe Alford napsal(a):
>>
>>                 Hello,
>>
>>                 Fix for https://fedorahosted.org/freeipa/ticket/4023
>>
>>
>>             Actually, 0 means unlimited for size limit, see
>>             <
>> http://www.python-ldap.org/doc/html/ldap.html#ldap.LDAPObject.search_ext_s
>> >.
>>
>>
>>         After reading the ticket I think this should be fixed the other
>>         way around: make 0 mean unlimited for both time and size limit
>>         and fix the config plugin and LDAPClient to respect that.
>>
>>
>>     Thanks for the review. Updated patch attached.
>>
>
> We still need to accept -1 in config-mod for backward compatibility - when
> received, it should be converted to 0.
>
> --
> Jan Cholasta
>
From 73a7fd9f2f3fbfa703da68f1a55bb16e4627ffba Mon Sep 17 00:00:00 2001
From: Gabe <redhatri...@gmail.com>
Date: Thu, 6 Aug 2015 13:18:06 -0600
Subject: [PATCH] Standardize minvalue for ipasearchrecordlimit and
 ipasesarchsizelimit for unlimited minvalue

https://fedorahosted.org/freeipa/ticket/4023
---
 API.txt                                     | 82 ++++++++++++++---------------
 VERSION                                     |  2 +-
 install/ui/test/data/ipa_init_commands.json |  4 +-
 install/ui/test/data/ipa_init_objects.json  |  4 +-
 install/ui/test/data/json_metadata.json     |  2 +-
 ipalib/plugins/baseldap.py                  |  6 +--
 ipalib/plugins/config.py                    |  7 ++-
 7 files changed, 56 insertions(+), 51 deletions(-)

diff --git a/API.txt b/API.txt
index 2e19d6b2f1e16cc1c89d71ed7d443145426a28e3..19c7857bee7cd7fb63c96a130b53946612f0c74e 100644
--- a/API.txt
+++ b/API.txt
@@ -273,7 +273,7 @@ option: IA5Str('automountinformation', attribute=True, autofill=False, cli_name=
 option: IA5Str('automountkey', attribute=True, autofill=False, cli_name='key', multivalue=False, query=True, required=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -337,7 +337,7 @@ option: Str('cn', attribute=True, autofill=False, cli_name='location', multivalu
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -412,7 +412,7 @@ option: Str('description', attribute=True, autofill=False, cli_name='desc', mult
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -556,7 +556,7 @@ option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: StrEnum('servicecategory', attribute=True, autofill=False, cli_name='servicecat', multivalue=False, query=True, required=False, values=(u'all',))
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: StrEnum('usercategory', attribute=True, autofill=False, cli_name='usercat', multivalue=False, query=True, required=False, values=(u'all',))
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
@@ -712,7 +712,7 @@ option: Bool('ipacertprofilestoreissued', attribute=True, autofill=False, cli_na
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -832,7 +832,7 @@ option: DNParam('krbpwdpolicyreference', attribute=True, autofill=False, cli_nam
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -1014,7 +1014,7 @@ option: Str('name_from_ip', attribute=False, autofill=False, cli_name='name_from
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -1244,7 +1244,7 @@ option: SPFRecord('spfrecord', attribute=True, autofill=False, cli_name='spf_rec
 option: SRVRecord('srvrecord', attribute=True, autofill=False, cli_name='srv_rec', csv=True, multivalue=True, option_group=None, query=True, required=False)
 option: SSHFPRecord('sshfprecord', attribute=True, autofill=False, cli_name='sshfp_rec', csv=True, multivalue=True, option_group=None, query=True, required=False)
 option: Flag('structured', autofill=True, default=False)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: TLSARecord('tlsarecord', attribute=True, autofill=False, cli_name='tlsa_rec', csv=True, multivalue=True, option_group=None, query=True, required=False)
 option: TXTRecord('txtrecord', attribute=True, autofill=False, cli_name='txt_rec', csv=True, multivalue=True, option_group=None, query=True, required=False)
 option: Str('version?', exclude='webui')
@@ -1456,7 +1456,7 @@ option: Str('nsec3paramrecord', attribute=True, autofill=False, cli_name='nsec3p
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -1603,7 +1603,7 @@ option: Flag('posix', autofill=True, cli_name='posix', default=False)
 option: Flag('private', autofill=True, cli_name='private', default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('user*', cli_name='users', csv=True)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
@@ -1763,7 +1763,7 @@ option: Int('sizelimit?', autofill=False, minvalue=0)
 option: DeprecatedParam('sourcehost_host', attribute=True, autofill=False, cli_name='sourcehost_host', multivalue=False, query=True, required=False)
 option: DeprecatedParam('sourcehost_hostgroup', attribute=True, autofill=False, cli_name='sourcehost_hostgroup', multivalue=False, query=True, required=False)
 option: DeprecatedParam('sourcehostcategory', attribute=True, autofill=False, cli_name='sourcehostcategory', multivalue=False, query=True, required=False)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: StrEnum('usercategory', attribute=True, autofill=False, cli_name='usercat', multivalue=False, query=True, required=False, values=(u'all',))
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
@@ -1884,7 +1884,7 @@ option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -1958,7 +1958,7 @@ option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -2174,7 +2174,7 @@ option: Str('nsosversion', attribute=True, autofill=False, cli_name='os', multiv
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Bytes('usercertificate', attribute=True, autofill=False, cli_name='certificate', multivalue=True, query=True, required=False)
 option: Str('userclass', attribute=True, autofill=False, cli_name='class', multivalue=True, query=True, required=False)
 option: Str('userpassword', attribute=True, autofill=False, cli_name='password', multivalue=False, query=True, required=False)
@@ -2302,7 +2302,7 @@ option: Str('not_in_sudorule*', cli_name='not_in_sudorules', csv=True)
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -2389,7 +2389,7 @@ option: Str('ipaanchoruuid', attribute=True, autofill=False, cli_name='anchor',
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -2474,7 +2474,7 @@ option: Str('loginshell', attribute=True, autofill=False, cli_name='shell', mult
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('uid', attribute=True, autofill=False, cli_name='login', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,252}[a-zA-Z0-9_.$-]?$', query=True, required=False)
 option: Int('uidnumber', attribute=True, autofill=False, cli_name='uid', minvalue=1, multivalue=False, query=True, required=False)
 option: Str('version?', exclude='webui')
@@ -2559,7 +2559,7 @@ option: Int('ipasecondarybaserid', attribute=True, autofill=False, cli_name='sec
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -2633,7 +2633,7 @@ option: Str('description', attribute=True, autofill=False, cli_name='desc', mult
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -2820,7 +2820,7 @@ option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('private', autofill=True, default=False, exclude='webui')
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('user*', cli_name='users', csv=True)
 option: StrEnum('usercategory', attribute=True, autofill=False, cli_name='usercat', multivalue=False, query=True, required=False, values=(u'all',))
 option: Str('version?', exclude='webui')
@@ -2980,7 +2980,7 @@ option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: StrEnum('type', attribute=False, autofill=False, cli_name='type', default=u'totp', multivalue=False, query=True, required=False, values=(u'totp', u'hotp', u'TOTP', u'HOTP'))
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
@@ -3135,7 +3135,7 @@ option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui
 option: Int('sizelimit?', autofill=False, minvalue=0)
 option: Str('subtree', attribute=False, autofill=False, cli_name='subtree', multivalue=True, query=True, required=False)
 option: Str('targetgroup', attribute=False, autofill=False, cli_name='targetgroup', multivalue=False, query=True, required=False)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('type', attribute=False, autofill=False, cli_name='type', multivalue=False, query=True, required=False)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
@@ -3266,7 +3266,7 @@ option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -3366,7 +3366,7 @@ option: Int('krbpwdminlength', attribute=True, autofill=False, cli_name='minleng
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -3444,7 +3444,7 @@ option: Str('ipatokenusermapattribute', attribute=True, autofill=False, cli_name
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -3562,7 +3562,7 @@ option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -3751,7 +3751,7 @@ option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Str('seealso', attribute=True, autofill=False, cli_name='hbacrule', multivalue=False, query=True, required=False)
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: StrEnum('usercategory', attribute=True, autofill=False, cli_name='usercat', multivalue=False, query=True, required=False, values=(u'all',))
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
@@ -3832,7 +3832,7 @@ option: Str('iparepltopomanagedsuffix', attribute=True, autofill=False, cli_name
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -3970,7 +3970,7 @@ option: Str('not_man_by_host*', cli_name='not_man_by_hosts', csv=True)
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -4079,7 +4079,7 @@ option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -4155,7 +4155,7 @@ option: Str('cn', attribute=True, autofill=False, cli_name='delegation_name', ma
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -4305,7 +4305,7 @@ option: Str('sn', attribute=True, autofill=False, cli_name='last', multivalue=Fa
 option: Str('st', attribute=True, autofill=False, cli_name='state', multivalue=False, query=True, required=False)
 option: Str('street', attribute=True, autofill=False, cli_name='street', multivalue=False, query=True, required=False)
 option: Str('telephonenumber', attribute=True, autofill=False, cli_name='phone', multivalue=True, query=True, required=False)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('title', attribute=True, autofill=False, cli_name='title', multivalue=False, query=True, required=False)
 option: Str('uid', attribute=True, autofill=False, cli_name='login', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,252}[a-zA-Z0-9_.$-]?$', primary_key=True, query=True, required=False)
 option: Int('uidnumber', attribute=True, autofill=False, cli_name='uid', minvalue=1, multivalue=False, query=True, required=False)
@@ -4410,7 +4410,7 @@ option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
 option: Str('sudocmd', attribute=True, autofill=False, cli_name='command', multivalue=False, primary_key=True, query=True, required=False)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -4484,7 +4484,7 @@ option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -4672,7 +4672,7 @@ option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
 option: Int('sudoorder', attribute=True, autofill=False, cli_name='order', default=0, minvalue=0, multivalue=False, query=True, required=False)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: StrEnum('usercategory', attribute=True, autofill=False, cli_name='usercat', multivalue=False, query=True, required=False, values=(u'all',))
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
@@ -4845,7 +4845,7 @@ option: Int('nsds5replicatimeout', attribute=True, autofill=False, cli_name='tim
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -4921,7 +4921,7 @@ option: Str('iparepltopoconfroot', attribute=True, autofill=False, cli_name='suf
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -5008,7 +5008,7 @@ option: Str('ipanttrusteddomainsid', attribute=True, autofill=False, cli_name='s
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -5123,7 +5123,7 @@ option: Str('ipanttrustpartner', attribute=True, autofill=False, cli_name='ipant
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
 output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
@@ -5283,7 +5283,7 @@ option: Str('sn', attribute=True, autofill=False, cli_name='last', multivalue=Fa
 option: Str('st', attribute=True, autofill=False, cli_name='state', multivalue=False, query=True, required=False)
 option: Str('street', attribute=True, autofill=False, cli_name='street', multivalue=False, query=True, required=False)
 option: Str('telephonenumber', attribute=True, autofill=False, cli_name='phone', multivalue=True, query=True, required=False)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('title', attribute=True, autofill=False, cli_name='title', multivalue=False, query=True, required=False)
 option: Str('uid', attribute=True, autofill=False, cli_name='login', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,252}[a-zA-Z0-9_.$-]?$', primary_key=True, query=True, required=False)
 option: Int('uidnumber', attribute=True, autofill=False, cli_name='uid', minvalue=1, multivalue=False, query=True, required=False)
@@ -5518,7 +5518,7 @@ option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui
 option: Str('service?')
 option: Flag('shared?', autofill=True, default=False)
 option: Int('sizelimit?', autofill=False, minvalue=0)
-option: Int('timelimit?', autofill=False, minvalue=0)
+option: Int('timelimit?', autofill=False, minvalue=-1)
 option: Str('username?', cli_name='user')
 option: Str('version?', exclude='webui')
 output: Output('count', <type 'int'>, None)
diff --git a/VERSION b/VERSION
index ca43f3e0c06880d355c068514134187c5edda175..f70c77cf6adc05bcd1dadeaf9cfd30b47bcf2c2e 100644
--- a/VERSION
+++ b/VERSION
@@ -91,4 +91,4 @@ IPA_DATA_VERSION=20100614120000
 ########################################################
 IPA_API_VERSION_MAJOR=2
 IPA_API_VERSION_MINOR=148
-# Last change: ftweedal - add --out option to user-show
+# Last change: galford - Change --timelimit to -1 for unlimited
diff --git a/install/ui/test/data/ipa_init_commands.json b/install/ui/test/data/ipa_init_commands.json
index 743f508e2a733b766008bdd21838454ef7df8c21..1846e2891362dbb82a50d7d5d2da0efc29cbc8c8 100644
--- a/install/ui/test/data/ipa_init_commands.json
+++ b/install/ui/test/data/ipa_init_commands.json
@@ -2460,7 +2460,7 @@
                         "attribute": true,
                         "class": "Int",
                         "deprecated_cli_aliases": [],
-                        "doc": "Maximum number of records to search (-1 is unlimited)",
+                        "doc": "Maximum number of records to search (0 is unlimited)",
                         "flags": [
                             "nonempty"
                         ],
@@ -24018,4 +24018,4 @@
         "methods": {},
         "objects": {}
     }
-}
\ No newline at end of file
+}
diff --git a/install/ui/test/data/ipa_init_objects.json b/install/ui/test/data/ipa_init_objects.json
index c8c836926d94dd4c1903aa9a62fa91c11a238e75..8f199dd7cd356dca1c9e9d0df36337d53827ef99 100644
--- a/install/ui/test/data/ipa_init_objects.json
+++ b/install/ui/test/data/ipa_init_objects.json
@@ -510,7 +510,7 @@
                     {
                         "class": "Int",
                         "deprecated_cli_aliases": [],
-                        "doc": "Maximum number of records to search (-1 is unlimited)",
+                        "doc": "Maximum number of records to search (0 is unlimited)",
                         "flags": [],
                         "label": "Search size limit",
                         "maxvalue": 2147483647,
@@ -9158,4 +9158,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}
diff --git a/install/ui/test/data/json_metadata.json b/install/ui/test/data/json_metadata.json
index a9e66230f94875f7da7efa73141e244b8201a5cc..fdc0bb205125d5d4fe5831766f07d731a991ebf5 100644
--- a/install/ui/test/data/json_metadata.json
+++ b/install/ui/test/data/json_metadata.json
@@ -2619,7 +2619,7 @@
                         "cli_name": "searchrecordslimit",
                         "cli_short_name": null,
                         "default": null,
-                        "doc": "Max. number of records to search (-1 is unlimited)",
+                        "doc": "Max. number of records to search (0 is unlimited)",
                         "exclude": null,
                         "flags": [],
                         "hint": null,
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 36a5d5f4918828a97b0b30d4613819f777722de8..60ac20ee6d713977df1657d750da60e813b7d4ba 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -1917,14 +1917,14 @@ class LDAPSearch(BaseLDAPCommand, crud.Search):
     takes_options = (
         Int('timelimit?',
             label=_('Time Limit'),
-            doc=_('Time limit of search in seconds'),
+            doc=_('Time limit of search in seconds (-1 is unlimited)'),
             flags=['no_display'],
-            minvalue=0,
+            minvalue=-1,
             autofill=False,
         ),
         Int('sizelimit?',
             label=_('Size Limit'),
-            doc=_('Maximum number of entries returned'),
+            doc=_('Maximum number of entries returned (0 is unlimited)'),
             flags=['no_display'],
             minvalue=0,
             autofill=False,
diff --git a/ipalib/plugins/config.py b/ipalib/plugins/config.py
index 6267313d5e9af2d97f45f987115de143d7aa7915..fb7ec912ecc270b5eefd8bff6efb58cfcfdfa243 100644
--- a/ipalib/plugins/config.py
+++ b/ipalib/plugins/config.py
@@ -159,7 +159,7 @@ class config(LDAPObject):
         Int('ipasearchrecordslimit',
             cli_name='searchrecordslimit',
             label=_('Search size limit'),
-            doc=_('Maximum number of records to search (-1 is unlimited)'),
+            doc=_('Maximum number of records to search (0 is unlimited)'),
             minvalue=-1,
         ),
         IA5Str('ipausersearchfields',
@@ -267,6 +267,11 @@ class config_mod(LDAPUpdate):
                             name=k, error=_('attribute "%s" not allowed') % a
                         )
 
+        # Set ipasearchrecordslimit to 0 if -1 is used
+        if 'ipasearchrecordslimit' in entry_attrs:
+            if entry_attrs['ipasearchrecordslimit'] < 0:
+                 entry_attrs['ipasearchrecordslimit'] = 0
+
         for (attr, obj) in (('ipauserobjectclasses', 'user'),
                             ('ipagroupobjectclasses', 'group')):
             if attr in entry_attrs:
-- 
1.8.3.1

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to