#include <ac/string.h>
#include "slap.h"
+#include "lber_pvt.h"
static struct extop_list {
struct extop_list *next;
#else
Debug( LDAP_DEBUG_TRACE, "do_extended\n", 0, 0, 0 );
#endif
+
if( op->o_protocol < LDAP_VERSION3 ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
refs = NULL;
rc = (ext->ext_main)( conn, op,
- reqoid.bv_val, &reqdata,
+ reqoid.bv_val, reqdata.bv_val ? &reqdata : NULL,
&rspoid, &rspdata, &rspctrls, &text, &refs );
if( rc != SLAPD_ABANDON ) {
}
-int
+static int
whoami_extop (
Connection *conn,
Operation *op,
const char ** text,
BerVarray * refs )
{
+ int rc;
struct berval *bv;
if ( reqdata != NULL ) {
return LDAP_PROTOCOL_ERROR;
}
+ {
+ int rc;
+ struct berval whoami = BER_BVC( LDAP_EXOP_X_WHO_AM_I );
+
+ rc = backend_check_restrictions( conn->c_authz_backend,
+ conn, op, &whoami, text );
+
+ if( rc != LDAP_SUCCESS ) return rc;
+ }
+
bv = (struct berval *) ch_malloc( sizeof(struct berval) );
if( op->o_dn.bv_len ) {
bv->bv_len = op->o_dn.bv_len + sizeof("dn:")-1;