if (( sc->sc_mask & tagmask ) == tagmask ) {
/* available extension */
+ int rc;
if( !sc->sc_parse ) {
rs->sr_err = LDAP_OTHER;
goto return_results;
}
- rs->sr_err = sc->sc_parse( op, rs, c );
- assert( rs->sr_err != LDAP_UNAVAILABLE_CRITICAL_EXTENSION );
- if( rs->sr_err != LDAP_SUCCESS ) goto return_results;
+ rc = sc->sc_parse( op, rs, c );
+ assert( rc != LDAP_UNAVAILABLE_CRITICAL_EXTENSION );
+ switch ( rc ) {
+ /* for some reason, the control should be ignored */
+ case SLAP_CTRL_IGNORE:
+ op->o_tmpfree( c, op->o_tmpmemctx );
+ op->o_ctrls[--nctrls] = NULL;
+ goto next_ctrl;
+
+ /* the control was successfully parsed */
+ case LDAP_SUCCESS:
+ break;
+
+ /* something happened... */
+ default:
+ rs->sr_err = rc;
+ goto return_results;
+ }
if ( sc->sc_mask & SLAP_CTRL_FRONTEND ) {
/* kludge to disable backend_control() check */
rs->sr_text = "critical extension is not recognized";
goto return_results;
}
+next_ctrl:;
}
return_results:
return LDAP_PROTOCOL_ERROR;
}
+ /*
+ * NOTE: according to RFC 2696 3.:
+ *
+ If the page size is greater than or equal to the sizeLimit value, the
+ server should ignore the control as the request can be satisfied in a
+ single page.
+ *
+ * NOTE: this assumes that the op->ors_slimit be set before the controls
+ * are parsed.
+ */
+ if ( op->ors_slimit > 0 && size >= op->ors_slimit ) {
+ return SLAP_CTRL_IGNORE;
+ }
+
if( cookie.bv_len ) {
PagedResultsCookie reqcookie;
if( cookie.bv_len != sizeof( reqcookie ) ) {
#endif
#define SLAP_CTRL_FRONTEND 0x00800000U
-#define SLAP_CTRL_FRONTEND_SEARCH 0x00010000U /* for NOOP */
+#define SLAP_CTRL_FRONTEND_SEARCH 0x00010000U /* for NOOP */
+#define SLAP_CTRL_IGNORE 0x00020000U
#define SLAP_CTRL_OPFLAGS 0x0000FFFFU
#define SLAP_CTRL_ABANDON 0x00000001U