Răsfoiți Sursa

Bug 606920 - anonymous resource limit- nstimelimit -
also applied to "cn=directory manager"

https://bugzilla.redhat.com/show_bug.cgi?id=606920

Description: Client side sizelimit / timelimit request should
be honoured by the Directory Manager, too. Changing the time/
sizelimit evaluation so that if client side request exists,
the value is set even if the bind user is the directory manager.

Noriko Hosoi 15 ani în urmă
părinte
comite
f980ff61da
1 a modificat fișierele cu 24 adăugiri și 12 ștergeri
  1. 24 12
      ldap/servers/slapd/opshared.c

+ 24 - 12
ldap/servers/slapd/opshared.c

@@ -1388,12 +1388,18 @@ compute_limits (Slapi_PBlock *pb)
         }
     }
 
-    if ( isroot ) {
-        timelimit = max_timelimit = -1;    /* no limit */
-    } else if ( requested_timelimit == 0 ) {
-        timelimit = ( max_timelimit == -1 ) ? -1 : max_timelimit;
-    } else if ( max_timelimit == -1 || requested_timelimit < max_timelimit ) {
-        timelimit = requested_timelimit;
+    if ( requested_timelimit ) {
+        /* requested limit should be applied to all (including root) */
+        if ( isroot ) {
+            timelimit = requested_timelimit;
+        } else if ( (max_timelimit == -1) ||
+                    (requested_timelimit < max_timelimit) ) {
+            timelimit = requested_timelimit;
+        } else {
+            timelimit = max_timelimit;
+        }
+    } else if ( isroot ) {
+        timelimit = -1;    /* no limit */
     } else {
         timelimit = max_timelimit;
     }
@@ -1419,12 +1425,18 @@ compute_limits (Slapi_PBlock *pb)
         }
     }
 
-    if ( isroot ) {
-        sizelimit = max_sizelimit = -1;
-    } else if ( requested_sizelimit == 0 ) {
-        sizelimit = ( max_sizelimit == -1 ) ? -1 : max_sizelimit;
-    } else if ( max_sizelimit == -1 || requested_sizelimit < max_sizelimit ) {
-        sizelimit = requested_sizelimit;
+    if ( requested_sizelimit ) {
+        /* requested limit should be applied to all (including root) */
+        if ( isroot ) {
+            sizelimit = requested_sizelimit;
+        } else if ( (max_sizelimit == -1) ||
+                    (requested_sizelimit < max_sizelimit) ) {
+            sizelimit = requested_sizelimit;
+        } else {
+            sizelimit = max_sizelimit;
+        }
+    } else if ( isroot ) {
+        sizelimit = -1;    /* no limit */
     } else {
         sizelimit = max_sizelimit;
     }