]> git.sur5r.net Git - openldap/commitdiff
yet another problem in pr limits
authorPierangelo Masarati <ando@openldap.org>
Sat, 17 Apr 2004 15:42:55 +0000 (15:42 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 17 Apr 2004 15:42:55 +0000 (15:42 +0000)
servers/slapd/limits.c

index 854c48c92076e5f01ce109b16a42ddc6bbad5430..7507094432ee526e76b775590bffdeabb15d24eb 100644 (file)
@@ -985,7 +985,7 @@ limits_check( Operation *op, SlapReply *rs )
                                pr_total = op->ors_limit->lms_s_pr_total;
                        }
 
-                       if ( op->ors_limit->lms_s_pr_total == -1 ) {
+                       if ( pr_total == -1 ) {
                                slimit = -1;
 
                        } else if ( pr_total > 0 && ( op->ors_slimit == -1 || op->ors_slimit > pr_total ) ) {
@@ -1047,19 +1047,19 @@ limits_check( Operation *op, SlapReply *rs )
                                if ( op->ors_slimit <= 0 ) {
                                        op->ors_slimit = slimit;
 
-                               } else if ( op->ors_slimit - op->o_pagedresults_state.ps_count > slimit ) {
-                                       rs->sr_err = LDAP_ADMINLIMIT_EXCEEDED;
-                                       send_ldap_result( op, rs );
-                                       rs->sr_err = LDAP_SUCCESS;
-                                       return -1;
-
-                               } else {
+                               } else if ( slimit > 0 ) {
+                                       if ( op->ors_slimit - op->o_pagedresults_state.ps_count > slimit ) {
+                                               rs->sr_err = LDAP_ADMINLIMIT_EXCEEDED;
+                                               send_ldap_result( op, rs );
+                                               rs->sr_err = LDAP_SUCCESS;
+                                               return -1;
+                                       }
                                        op->ors_slimit = slimit;
                                }
 
                        } else {
                                /* use the standard hard/soft limit if any */
-                               op->ors_slimit = op->ors_limit->lms_s_hard;
+                               op->ors_slimit = pr_total;
                        }
 
                /* no limit requested: use soft, whatever it is */