]> git.sur5r.net Git - openldap/commitdiff
fix ITS#2343
authorPierangelo Masarati <ando@openldap.org>
Mon, 3 Mar 2003 22:25:28 +0000 (22:25 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 3 Mar 2003 22:25:28 +0000 (22:25 +0000)
servers/slapd/back-monitor/database.c
servers/slapd/backend.c
servers/slapd/backglue.c
servers/slapd/root_dse.c
servers/slapd/slap.h
servers/slapd/tools/slapcommon.c

index 0a2ee4b13dd31fc88d90c42811ab496d56a4874c..05a6688f8aa9a71dbce4300c136768f2f66ecf1f 100644 (file)
@@ -103,7 +103,7 @@ monitor_subsys_database_init(
                be = &backendDB[i];
 
                /* Subordinates are not exposed as their own naming context */
-               if ( be->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE ) {
+               if ( SLAP_GLUE_SUBORDINATE( be ) ) {
                        continue;
                }
 
index 07877bad8d07daed3acacf46e2e5592d0817de09..2d7c040baacb2c4026c4be91fec7afc3dbbd8dfe 100644 (file)
@@ -536,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;
index 8ffccd74f5f1a9ccebd01e72f0b802c8bb67b3d3..4db1e9f40a476d249dc763bef6c7d3e569952e3d 100644 (file)
@@ -610,7 +610,7 @@ glue_sub_init( )
         * backends and connect them to their superior.
         */
        for (i = nBackendDB - 1, b1=&backendDB[i]; cont && i>=0; b1--,i--) {
-               if (b1->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE) {
+               if (SLAP_GLUE_SUBORDINATE ( b1 ) ) {
                        /* The last database cannot be a subordinate of noone */
                        if (i == nBackendDB - 1) {
                                b1->be_flags ^= SLAP_BFLAG_GLUE_SUBORDINATE;
@@ -619,11 +619,11 @@ glue_sub_init( )
                }
                gi = NULL;
                for (j = i-1, be=&backendDB[j]; j>=0; be--,j--) {
-                       if (!(be->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE)) {
+                       if ( ! SLAP_GLUE_SUBORDINATE( be ) ) {
                                continue;
                        }
                        /* We will only link it once */
-                       if (be->be_flags & SLAP_BFLAG_GLUE_LINKED) {
+                       if ( SLAP_GLUE_LINKED( be ) ) {
                                continue;
                        }
                        if (!dnIsSuffix(&be->be_nsuffix[0], &b1->be_nsuffix[0])) {
index bb8e5ed8c535de8b6ce59728c0e888a75db31e8a..5ab1467bc147da11f34c90817f2750edd2a32121 100644 (file)
@@ -137,7 +137,7 @@ root_dse_info(
                        }
                        continue;
                }
-               if ( backends[i].be_flags & SLAP_BFLAG_GLUE_SUBORDINATE ) {
+               if ( SLAP_GLUE_SUBORDINATE( &backends[i] ) ) {
                        continue;
                }
                for ( j = 0; backends[i].be_suffix[j].bv_val != NULL; j++ ) {
index 80a5f4aa4835e5bada4127d5f2bce647117abe77..217d7c44afde0b29e635e6c09a110032b07e403e 100644 (file)
@@ -1334,6 +1334,10 @@ struct slap_backend_db {
 #define SLAP_BFLAG_DYNAMIC             0x2000U
        slap_mask_t     be_flags;
 #define SLAP_LASTMOD(be)       (!((be)->be_flags & SLAP_BFLAG_NOLASTMOD))
+#define        SLAP_GLUE_INSTANCE(be)  ((be)->be_flags & SLAP_BFLAG_GLUE_INSTANCE)
+#define        SLAP_GLUE_SUBORDINATE(be) \
+       ((be)->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE)
+#define        SLAP_GLUE_LINKED(be)    ((be)->be_flags & SLAP_BFLAG_GLUE_LINKED)
 #define SLAP_ALIASES(be)       ((be)->be_flags & SLAP_BFLAG_ALIASES)
 #define SLAP_REFERRALS(be)     ((be)->be_flags & SLAP_BFLAG_REFERRALS)
 #define SLAP_SUBENTRIES(be)    ((be)->be_flags & SLAP_BFLAG_SUBENTRIES)
index 37cb8eafe94c680b74788b56ac27a3b8f28f5178..167eaf80d7982f525f7ed857be5676bebac6d63b 100644 (file)
@@ -250,7 +250,7 @@ slap_tool_init(
                /* If the named base is a glue master, operate on the
                 * entire context
                 */
-               if (be->be_flags & SLAP_BFLAG_GLUE_INSTANCE)
+               if (SLAP_GLUE_INSTANCE(be))
                        nosubordinates = 1;
 
        } else if ( dbnum == -1 ) {
@@ -258,8 +258,10 @@ slap_tool_init(
                /* If just doing the first by default and it is a
                 * glue subordinate, find the master.
                 */
-               while (be->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE) {
-                       nosubordinates = 1;
+               while (SLAP_GLUE_SUBORDINATE(be) || SLAP_MONITOR(be)) {
+                       if (SLAP_GLUE_SUBORDINATE(be)) {
+                               nosubordinates = 1;
+                       }
                        be++;
                }