X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fextended.c;h=ace5cb55f14e863a1701bec478e1368f63c54d4d;hb=62139b6ef3634529c6d1ff726c337e685ea38cf8;hp=ec49fe5c58c99a21c130593c8cd16557378b6cc0;hpb=81c3c311a8ba260da7edc6db89760d6fefb381a3;p=openldap diff --git a/servers/slapd/extended.c b/servers/slapd/extended.c index ec49fe5c58..ace5cb55f1 100644 --- a/servers/slapd/extended.c +++ b/servers/slapd/extended.c @@ -32,6 +32,7 @@ #include #include "slap.h" +#include "lber_pvt.h" static struct extop_list { struct extop_list *next; @@ -107,6 +108,7 @@ do_extended( #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, @@ -200,7 +202,7 @@ do_extended( 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 ) { @@ -294,7 +296,7 @@ find_extop( struct extop_list *list, struct berval *oid ) } -int +static int whoami_extop ( Connection *conn, Operation *op, @@ -306,6 +308,7 @@ whoami_extop ( const char ** text, BerVarray * refs ) { + int rc; struct berval *bv; if ( reqdata != NULL ) { @@ -314,6 +317,16 @@ whoami_extop ( 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;