]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/extended.c
Set peeraddr also for IPv6, fixes ITS#1918
[openldap] / servers / slapd / extended.c
index 64e8cc2df41738267f63169d682c2a76e2d05a47..ace5cb55f14e863a1701bec478e1368f63c54d4d 100644 (file)
@@ -32,6 +32,7 @@
 #include <ac/string.h>
 
 #include "slap.h"
+#include "lber_pvt.h"
 
 static struct extop_list {
        struct extop_list *next;
@@ -307,6 +308,7 @@ whoami_extop (
        const char ** text,
        BerVarray * refs )
 {
+       int rc;
        struct berval *bv;
 
        if ( reqdata != NULL ) {
@@ -315,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;