Use exop_is_write() macro

This commit is contained in:
Howard Chu 2004-11-19 23:27:02 +00:00
parent 59b50101bd
commit d7c5ccabe9

View File

@ -110,11 +110,6 @@ static struct m_s {
{ NULL }
};
static const struct berval *write_exop[] = {
&slap_EXOP_MODIFY_PASSWD,
NULL
};
static int
lastmod_search( Operation *op, SlapReply *rs )
{
@ -303,13 +298,11 @@ lastmod_op_func( Operation *op, SlapReply *rs )
case LDAP_REQ_EXTENDED:
/* if write, reject; otherwise process */
for ( i = 0; write_exop[ i ] != NULL; i++ ) {
if ( ber_bvcmp( write_exop[ i ], &op->oq_extended.rs_reqoid ) == 0 ) {
if ( exop_is_write( op )) {
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
rs->sr_text = "not allowed within namingContext";
goto return_error;
}
}
return lastmod_exop( op, rs );
case LDAP_REQ_MODIFY:
@ -676,13 +669,10 @@ lastmod_response( Operation *op, SlapReply *rs )
case LDAP_REQ_EXTENDED:
/* if write, process */
for ( i = 0; write_exop[ i ] != NULL; i++ ) {
if ( ber_bvcmp( write_exop[ i ], &op->oq_extended.rs_reqoid ) == 0 ) {
goto process;
}
}
/* fall thru */
if ( exop_is_write( op ))
break;
/* fall thru */
default:
return SLAP_CB_CONTINUE;
}