summaryrefslogtreecommitdiffstats
path: root/ldap/servers
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2008-06-04 23:00:48 +0000
committerNoriko Hosoi <nhosoi@redhat.com>2008-06-04 23:00:48 +0000
commit4e51f606f8f8c11fc48867096c49fa5181bed925 (patch)
treef76eba239cab173d951bc74a6133b9a18f271293 /ldap/servers
parent89517d1f8e4a5acf42ec9169e11db2e6d093b294 (diff)
downloadds-4e51f606f8f8c11fc48867096c49fa5181bed925.tar.gz
ds-4e51f606f8f8c11fc48867096c49fa5181bed925.tar.xz
ds-4e51f606f8f8c11fc48867096c49fa5181bed925.zip
Resolves: #436837
Summary: Dynamically reload schema via task interface Description: implemented task based schema file reloading (see also http://directory.fedoraproject.org/wiki/Dynamically_Reload_Schema)
Diffstat (limited to 'ldap/servers')
-rw-r--r--ldap/servers/slapd/back-ldbm/init.c47
1 files changed, 29 insertions, 18 deletions
diff --git a/ldap/servers/slapd/back-ldbm/init.c b/ldap/servers/slapd/back-ldbm/init.c
index 9f138a3e..f6c00aa8 100644
--- a/ldap/servers/slapd/back-ldbm/init.c
+++ b/ldap/servers/slapd/back-ldbm/init.c
@@ -64,6 +64,29 @@ plugin_init_debug_level(int *level_ptr)
}
#endif
+/* pb: not used */
+int
+ldbm_back_add_schema( Slapi_PBlock *pb )
+{
+ int rc = add_ldbm_internal_attr_syntax( "entrydn",
+ LDBM_ENTRYDN_OID, DN_SYNTAX_OID, DNMATCH_NAME,
+ SLAPI_ATTR_FLAG_SINGLE );
+
+ rc |= add_ldbm_internal_attr_syntax( "dncomp",
+ LDBM_DNCOMP_OID, DN_SYNTAX_OID, DNMATCH_NAME,
+ 0 );
+
+ rc |= add_ldbm_internal_attr_syntax( "parentid",
+ LDBM_PARENTID_OID, DIRSTRING_SYNTAX_OID, CASEIGNOREMATCH_NAME,
+ SLAPI_ATTR_FLAG_SINGLE );
+
+ rc |= add_ldbm_internal_attr_syntax( "entryid",
+ LDBM_ENTRYID_OID, DIRSTRING_SYNTAX_OID, CASEIGNOREMATCH_NAME,
+ SLAPI_ATTR_FLAG_SINGLE );
+
+ return rc;
+}
+
int
ldbm_back_init( Slapi_PBlock *pb )
{
@@ -114,21 +137,7 @@ ldbm_back_init( Slapi_PBlock *pb )
}
/* add some private attributes */
- rc = add_ldbm_internal_attr_syntax( "entrydn",
- LDBM_ENTRYDN_OID, DN_SYNTAX_OID, DNMATCH_NAME,
- SLAPI_ATTR_FLAG_SINGLE );
-
- rc = add_ldbm_internal_attr_syntax( "dncomp",
- LDBM_DNCOMP_OID, DN_SYNTAX_OID, DNMATCH_NAME,
- 0 );
-
- rc = add_ldbm_internal_attr_syntax( "parentid",
- LDBM_PARENTID_OID, DIRSTRING_SYNTAX_OID, CASEIGNOREMATCH_NAME,
- SLAPI_ATTR_FLAG_SINGLE );
-
- rc = add_ldbm_internal_attr_syntax( "entryid",
- LDBM_ENTRYID_OID, DIRSTRING_SYNTAX_OID, CASEIGNOREMATCH_NAME,
- SLAPI_ATTR_FLAG_SINGLE );
+ rc = ldbm_back_add_schema( pb );
/* set plugin private pointer and initialize locks, etc. */
rc = slapi_pblock_set( pb, SLAPI_PLUGIN_PRIVATE, (void *) li );
@@ -222,10 +231,12 @@ ldbm_back_init( Slapi_PBlock *pb )
rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DB_TEST_FN,
(void *) ldbm_back_db_test );
rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DB_INIT_INSTANCE_FN,
- (void *) ldbm_back_init ); /* register itself so that the secon instance
+ (void *) ldbm_back_init ); /* register itself so that the secon instance
can be initialized */
- rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DB_WIRE_IMPORT_FN,
- (void *) ldbm_back_wire_import);
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DB_WIRE_IMPORT_FN,
+ (void *) ldbm_back_wire_import );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DB_ADD_SCHEMA_FN,
+ (void *) ldbm_back_add_schema );
if ( rc != 0 ) {
LDAPDebug( LDAP_DEBUG_ANY, "ldbm_back_init failed\n", 0, 0, 0 );