]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backend.c
Commit of the Proxy Cache contribution (ITS#2062)
[openldap] / servers / slapd / backend.c
index 4895c4c54f0370de164f0f151ae43d618d433d97..2d7c040baacb2c4026c4be91fec7afc3dbbd8dfe 100644 (file)
@@ -9,15 +9,19 @@
 #include "portable.h"
 
 #include <stdio.h>
+
 #include <ac/string.h>
 #include <ac/socket.h>
 #include <sys/stat.h>
 
 #include "slap.h"
-#include "slapi.h"
 #include "lutil.h"
 #include "lber_pvt.h"
 
+#ifdef LDAP_SLAPI
+#include "slapi.h"
+#endif
+
 /*
  * If a module is configured as dynamic, its header should not
  * get included into slapd. While this is a general rule and does
@@ -532,7 +536,7 @@ select_backend(
                for ( j = 0; backends[i].be_nsuffix != NULL &&
                    backends[i].be_nsuffix[j].bv_val != NULL; j++ )
                {
-                       if (( backends[i].be_flags & SLAP_BFLAG_GLUE_SUBORDINATE )
+                       if ( ( SLAP_GLUE_SUBORDINATE( &backends[i] ) )
                                && noSubs )
                        {
                                continue;
@@ -686,9 +690,9 @@ backend_unbind(
 )
 {
        int             i;
+#if defined( LDAP_SLAPI )
        Slapi_PBlock *pb = op->o_pb;
 
-#if defined( LDAP_SLAPI )
        int     rc;
        slapi_x_connection_set_pb( pb, conn );
        slapi_x_operation_set_pb( pb, op );
@@ -852,8 +856,7 @@ backend_check_restrictions(
                }
 
                {
-                       struct berval bv = BER_BVC( LDAP_EXOP_START_TLS );
-                       if( bvmatch( opdata, &bv ) ) {
+                       if( bvmatch( opdata, &slap_EXOP_START_TLS ) ) {
                                session++;
                                starttls++;
                                break;
@@ -861,18 +864,18 @@ backend_check_restrictions(
                }
 
                {
-                       struct berval bv = BER_BVC( LDAP_EXOP_X_WHO_AM_I );
-                       if( bvmatch( opdata, &bv ) ) {
+                       if( bvmatch( opdata, &slap_EXOP_WHOAMI ) ) {
                                break;
                        }
                }
 
+#ifdef LDAP_EXOP_X_CANCEL
                {
-                       struct berval bv = BER_BVC( LDAP_EXOP_X_CANCEL );
-                       if ( bvmatch( opdata, &bv ) ) {
+                       if ( bvmatch( opdata, &slap_EXOP_CANCEL ) ) {
                                break;
                        }
                }
+#endif
 
                /* treat everything else as a modify */
                opflag = SLAP_RESTRICT_OP_MODIFY;