s4-dsdb: convert the simple_ldap_map module to the new module style
authorAndrew Tridgell <tridge@samba.org>
Mon, 1 Nov 2010 01:39:49 +0000 (12:39 +1100)
committerAndrew Tridgell <tridge@samba.org>
Mon, 1 Nov 2010 07:55:19 +0000 (18:55 +1100)
source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
source4/dsdb/samdb/ldb_modules/wscript_build

index 36c984f947335fb070bfed819a9c58e227ef844e..cee952126d4f183eb407086d3005261868b5b4fc 100644 (file)
@@ -920,16 +920,33 @@ static int entryuuid_extended(struct ldb_module *module, struct ldb_request *req
        return ldb_next_request(module, req);
 }
 
-_PUBLIC_ const struct ldb_module_ops ldb_entryuuid_module_ops = {
+static const struct ldb_module_ops ldb_entryuuid_module_ops = {
        .name              = "entryuuid",
        .init_context      = entryuuid_init,
        .extended          = entryuuid_extended,
        LDB_MAP_OPS
 };
 
-_PUBLIC_ const struct ldb_module_ops ldb_nsuniqueid_module_ops = {
+static const struct ldb_module_ops ldb_nsuniqueid_module_ops = {
        .name              = "nsuniqueid",
        .init_context      = nsuniqueid_init,
        .extended          = entryuuid_extended,
        LDB_MAP_OPS
 };
+
+/*
+  initialise the module
+ */
+_PUBLIC_ int ldb_simple_ldap_map_init(const char *ldb_version)
+{
+       int ret;
+       ret = ldb_register_module(&ldb_entryuuid_module_ops);
+       if (ret != LDB_SUCCESS) {
+               return ret;
+       }
+       ret = ldb_register_module(&ldb_nsuniqueid_module_ops);
+       if (ret != LDB_SUCCESS) {
+               return ret;
+       }
+       return LDB_SUCCESS;
+}
index a78b22638390ac0ac30fec8fa31fa8568162a93f..4bf89d294b2f2478c2a23299adf8349e75046f51 100644 (file)
@@ -133,13 +133,13 @@ bld.SAMBA_MODULE('ldb_samba3sid',
 
 
 bld.SAMBA_MODULE('ldb_simple_ldap_map',
-       source='simple_ldap_map.c',
-       aliases='ldb_entryuuid ldb_nsuniqueid',
-       subsystem='ldb',
-       init_function='LDB_MODULE(entryuuid),LDB_MODULE(nsuniqueid)',
-       internal_module=False,
-       deps='talloc events ldb ndr LDBSAMBA'
-       )
+                 source='simple_ldap_map.c',
+                 subsystem='ldb',
+                 init_function='ldb_simple_ldap_map_init',
+                 module_init_name='ldb_init_module',
+                 internal_module=False,
+                 deps='talloc events ldb ndr LDBSAMBA'
+                 )
 
 
 bld.SAMBA_MODULE('ldb_rootdse',