<div dir="ltr"><div><div>Makes sense. I also changed the doc string to reflect -1 as well. Updated patch attached.<br><br></div>Thanks,<br><br></div>Gabe<br><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 10, 2015 at 1:41 AM, Jan Cholasta <span dir="ltr"><<a href="mailto:jcholast@redhat.com" target="_blank">jcholast@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 4.9.2015 14:43, Gabe Alford wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Bump for review.<br>
<br>
On Wed, Aug 12, 2015 at 9:32 AM, Gabe Alford <<a href="mailto:redhatrises@gmail.com" target="_blank">redhatrises@gmail.com</a><br></span><span class="">
<mailto:<a href="mailto:redhatrises@gmail.com" target="_blank">redhatrises@gmail.com</a>>> wrote:<br>
<br>
    On Tue, Aug 11, 2015 at 1:34 AM, Jan Cholasta <<a href="mailto:jcholast@redhat.com" target="_blank">jcholast@redhat.com</a><br></span><div><div class="h5">
    <mailto:<a href="mailto:jcholast@redhat.com" target="_blank">jcholast@redhat.com</a>>> wrote:<br>
<br>
        On 6.8.2015 21:43, Gabe Alford wrote:<br>
<br>
            Hello,<br>
<br>
            Updated patch attached.<br>
<br>
            - Time limit is -1 for unlimited. I found this<br>
            <a href="https://www.redhat.com/archives/freeipa-devel/2011-January/msg00330.html" rel="noreferrer" target="_blank">https://www.redhat.com/archives/freeipa-devel/2011-January/msg00330.html</a><br>
            in reference to keeping the time limit as -1 for unlimited.<br>
<br>
<br>
        This patch does two conflicting things: it coerces time limit of<br>
        0 to -1 and at the same time prohibits the user to use 0 for<br>
        time limit. We should do just one of these and IMHO it should be<br>
        the coercion of 0 to -1.<br>
<br>
            Sure enough, testing time limit at 0 did not work for<br>
            unlimited as well<br>
            as appeared to have negative effects on IPA.<br>
<br>
<br>
        This is because the time limit read from ipa config is not<br>
        converted to int in ldap2.find_entries(), so the coercion does<br>
        not work. Fix this and 0 will work just fine.<br>
<br>
            Also, I believe that<br>
            <a href="http://www.python-ldap.org/doc/html/ldap.html#ldap.LDAPObject.search_ext_s" rel="noreferrer" target="_blank">http://www.python-ldap.org/doc/html/ldap.html#ldap.LDAPObject.search_ext_s</a><br>
            specifies unlimited for time limit as -1. (Please correct me<br>
            if I am wrong.)<br>
<br>
<br>
        python-ldap is layers below our API and should not determine<br>
        what we use for unlimited time limit. I would prefer if we were<br>
        self-consistent and use 0 for both time limit and size limit.<br>
<br>
<br>
    A misunderstanding on my part as I thought it was higher up in the<br>
    API for some reason. Updated patch attached.<br>
</div></div></blockquote>
<br>
Thanks, this is better, but it turns out I was wrong about coercing -1 to 0 in config-mod: in a topology with different versions of IPA servers, setting the limits in LDAP to 0 on a newer server with your patch will break older servers without your patch:<br>
<br>
    [user@old]$ ipa user-find<br>
    --------------<br>
    1 user matched<br>
    --------------<br>
      User login: admin<br>
      Last name: Administrator<br>
      Home directory: /home/admin<br>
      Login shell: /bin/bash<br>
      UID: 1364800000<br>
      GID: 1364800000<br>
      Account disabled: False<br>
      Password: True<br>
      Kerberos keys available: True<br>
    ----------------------------<br>
    Number of entries returned 1<br>
    ----------------------------<br>
<br>
    [user@new]$ ipa config-mod --searchtimelimit=0 --searchrecordslimit=0<br>
    ...<br>
<br>
    [user@old]$ ipa user-find<br>
    ---------------<br>
    0 users matched<br>
    ---------------<br>
    ----------------------------<br>
    Number of entries returned 0<br>
    ----------------------------<br>
<br>
To fix this, we actually need to do the opposite and store -1 in LDAP when 0 is specified in config-mod options.<br>
<br>
Honza<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Jan Cholasta<br>
</font></span></blockquote></div><br></div></div></div></div></div>