ignore non-critical control with unrecognized flags (ITS#6480)

This commit is contained in:
Pierangelo Masarati 2010-02-22 21:53:38 +00:00
parent a2dc37d053
commit 0394c805ab

View File

@ -1671,6 +1671,24 @@ static int parseSearchOptions (
return LDAP_PROTOCOL_ERROR; return LDAP_PROTOCOL_ERROR;
} }
if ( search_flags & ~(LDAP_SEARCH_FLAG_DOMAIN_SCOPE) ) {
/* Search flags not recognised so far,
* including:
* LDAP_SEARCH_FLAG_PHANTOM_ROOT
*/
if ( ctrl->ldctl_iscritical ) {
rs->sr_text = "searchOptions contained unrecognized flag";
return LDAP_UNWILLING_TO_PERFORM;
}
/* Ignore */
Debug( LDAP_DEBUG_TRACE,
"searchOptions: conn=%lu unrecognized flag(s) 0x%x (non-critical)\n",
op->o_connid, (unsigned)search_flags, 0 );
return LDAP_SUCCESS;
}
if ( search_flags & LDAP_SEARCH_FLAG_DOMAIN_SCOPE ) { if ( search_flags & LDAP_SEARCH_FLAG_DOMAIN_SCOPE ) {
if ( op->o_domain_scope != SLAP_CONTROL_NONE ) { if ( op->o_domain_scope != SLAP_CONTROL_NONE ) {
rs->sr_text = "searchOptions control specified multiple times " rs->sr_text = "searchOptions control specified multiple times "
@ -1683,15 +1701,6 @@ static int parseSearchOptions (
: SLAP_CONTROL_NONCRITICAL; : SLAP_CONTROL_NONCRITICAL;
} }
if ( search_flags & ~(LDAP_SEARCH_FLAG_DOMAIN_SCOPE) ) {
/* Other search flags not recognised so far,
* including:
* LDAP_SEARCH_FLAG_PHANTOM_ROOM
*/
rs->sr_text = "searchOptions contained unrecognized flag";
return LDAP_UNWILLING_TO_PERFORM;
}
return LDAP_SUCCESS; return LDAP_SUCCESS;
} }