]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Complain if syncprov is instantiated outside of a database definition
authorQuanah Gibson-Mount <quanah@openldap.org>
Sat, 16 Dec 2006 01:26:40 +0000 (01:26 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Sat, 16 Dec 2006 01:26:40 +0000 (01:26 +0000)
servers/slapd/overlays/syncprov.c
servers/slapd/slap.h

index a466f52022e8121378f2b079fca9f9de8f785317..da425200935c782b604e4cd718133985b1295260 100644 (file)
@@ -2474,6 +2474,13 @@ syncprov_db_init(
        slap_overinst   *on = (slap_overinst *)be->bd_info;
        syncprov_info_t *si;
 
+       if ( SLAP_ISGLOBALOVERLAY( be ) ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "syncprov must be instantiated within a database.\n",
+                       0, 0, 0 );
+               return 1;
+       }
+
        si = ch_calloc(1, sizeof(syncprov_info_t));
        on->on_bi.bi_private = si;
        ldap_pvt_thread_mutex_init( &si->si_csn_mutex );
index a19420c5a2ac9489f684cbc5e4aae667e12a2854..0c7ae1d410f035a7ee66829f6e990c5cf7f14cb8 100644 (file)
@@ -1746,6 +1746,7 @@ struct slap_backend_db {
 #define SLAP_NOLASTMOD(be)                     (SLAP_DBFLAGS(be) & SLAP_DBFLAG_NOLASTMOD)
 #define SLAP_LASTMOD(be)                       (!SLAP_NOLASTMOD(be))
 #define SLAP_ISOVERLAY(be)                     (SLAP_DBFLAGS(be) & SLAP_DBFLAG_OVERLAY)
+#define SLAP_ISGLOBALOVERLAY(be)       (SLAP_DBFLAGS(be) & SLAP_DBFLAG_GLOBAL_OVERLAY)
 #define SLAP_NO_SCHEMA_CHECK(be)       \
        (SLAP_DBFLAGS(be) & SLAP_DBFLAG_NO_SCHEMA_CHECK)
 #define        SLAP_GLUE_INSTANCE(be)          \