]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#8859 Allow backends which do not need a database to work
authorNadezhda Ivanova <nivanova@symas.com>
Mon, 21 May 2018 14:45:21 +0000 (15:45 +0100)
committerOndřej Kuzník <ondra@openldap.org>
Fri, 19 Oct 2018 12:08:09 +0000 (13:08 +0100)
servers/slapd/bconfig.c
servers/slapd/config.c
servers/slapd/slap.h

index bc8d112677088f6bdcc9e17ffd9557df55016add..a638628434fcd7bece7e3bc3bf9e3f3728a6d400 100644 (file)
@@ -1702,6 +1702,10 @@ config_generic(ConfigArgs *c) {
                                        c->log, c->cr_msg, c->argv[1] );
                                return(1);
                        }
+                       if ( c->bi->bi_flags & SLAP_BFLAG_STANDALONE ) {
+                               c->bi->bi_nDB++;
+                               nbackends++;
+                       }
                        break;
 
                case CFG_DATABASE:
@@ -7217,7 +7221,7 @@ config_back_db_open( BackendDB *be, ConfigReply *cr )
                        }
                        continue;
                }
-               if (!bi->bi_private) continue;
+               if ( !bi->bi_private && !(bi->bi_flags & SLAP_BFLAG_STANDALONE) ) continue;
 
                rdn.bv_val = c.log;
                rdn.bv_len = snprintf(rdn.bv_val, sizeof( c.log ),
index 67ad0243664b1001decb44e7b1bb2bd18c8b3723..c9560787df857a54453ab8c1e05204f823e7004c 100644 (file)
@@ -835,7 +835,7 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf, ConfigTable *cft)
                                goto done;
                        }
                        
-               } else if ( c->bi && !c->be ) {
+               } else if ( ( c->bi && !c->be ) || ( c->bi && c->bi->bi_flags & SLAP_BFLAG_STANDALONE ) ) {
                        rc = SLAP_CONF_UNKNOWN;
                        if ( c->bi->bi_cf_ocs ) {
                                ct = config_find_keyword( c->bi->bi_cf_ocs->co_table, c );
index ef2d0b2af53f4719210375ff6f2e2cef7034f536..4c0dde1b83e3087a13d45d1c46215f0297f6d3f0 100644 (file)
@@ -2345,6 +2345,7 @@ struct BackendInfo {
 #define SLAP_BFLAG_REFERRALS           0x2000U
 #define SLAP_BFLAG_SUBENTRIES          0x4000U
 #define SLAP_BFLAG_DYNAMIC                     0x8000U
+#define SLAP_BFLAG_STANDALONE          0x10000U /* started up regardless of whether any databases use it */
 
 /* overlay specific */
 #define        SLAPO_BFLAG_SINGLE              0x01000000U