Fix static module list generation for ldb.
authorJelmer Vernooij <jelmer@samba.org>
Wed, 20 Feb 2008 02:40:44 +0000 (03:40 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 20 Feb 2008 02:40:44 +0000 (03:40 +0100)
20 files changed:
source/build/smb_build/header.pm
source/lib/ldb/common/ldb.c
source/lib/ldb/config.mk
source/lib/ldb/ldb_ildap/config.mk
source/lib/ldb/modules/paged_searches.c
source/lib/ldb/nssldb/ldb-nss.c
source/lib/ldb/tools/ad2oLschema.c
source/lib/ldb/tools/cmdline.c
source/lib/ldb/tools/ldbadd.c
source/lib/ldb/tools/ldbdel.c
source/lib/ldb/tools/ldbedit.c
source/lib/ldb/tools/ldbmodify.c
source/lib/ldb/tools/ldbrename.c
source/lib/ldb/tools/ldbsearch.c
source/lib/ldb/tools/ldbtest.c
source/lib/ldb/tools/oLschema2ldif.c
source/scripting/ejs/smbscript.c
source/smbd/server.c
source/torture/smbtorture.c
source/utils/net/net.c

index 93240f1d17b40f362df66ea6d7831658191db6a2..c2bdbaf4c89f7761208eb84193dcb81cde08853b 100644 (file)
@@ -44,8 +44,14 @@ sub _prepare_build_h($)
                        $DEFINE->{VAL} .= "\t$_, \\\n";
                        unless (/{/) {
                                my $fn = $key->{INIT_FUNCTION_TYPE};
-                               $fn =~ s/\(\*\)/$_/;
-                               $output .= "$fn;\n";
+                               my $n = $_;
+                               if ($fn =~ /\(\*\)/) {
+                                       $fn =~ s/\(\*\)/$n/;
+                                       $output .= "$fn;\n";
+                               } else {
+                                       $n =~ s/\&//;
+                                       $output .= "$fn $n;\n";
+                               }
                        }
                }
 
index ce69256c69154e2f818e471a1e7cbe7d4600315d..5f2e5e3ffc7a0cb9439b995271a4fa35495ba7b4 100644 (file)
@@ -282,7 +282,6 @@ int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, co
        int ret;
        const char *url2;
        /* We seem to need to do this here, or else some utilities don't get ldb backends */
-       ldb_global_init();
 
        ldb->flags = flags;
 
index 0e7caa381f9a768e270ba30e50aa7e6b34ba4683..b44a317a704ec9c42f96cab056df42df383b4e4a 100644 (file)
@@ -3,7 +3,7 @@
 [MODULE::ldb_asq]
 PRIVATE_DEPENDENCIES = LIBTALLOC
 CFLAGS = -Ilib/ldb/include
-INIT_FUNCTION = ldb_asq_init
+INIT_FUNCTION = &ldb_asq_module_ops
 SUBSYSTEM = LIBLDB
 OBJ_FILES = \
                modules/asq.o
@@ -15,7 +15,7 @@ OBJ_FILES = \
 [MODULE::ldb_server_sort]
 PRIVATE_DEPENDENCIES = LIBTALLOC
 CFLAGS = -Ilib/ldb/include
-INIT_FUNCTION = ldb_sort_init
+INIT_FUNCTION = &ldb_server_sort_module_ops
 SUBSYSTEM = LIBLDB
 OBJ_FILES = \
                modules/sort.o
@@ -25,7 +25,7 @@ OBJ_FILES = \
 ################################################
 # Start MODULE ldb_paged_results
 [MODULE::ldb_paged_results]
-INIT_FUNCTION = ldb_paged_results_init
+INIT_FUNCTION = &ldb_paged_results_module_ops
 CFLAGS = -Ilib/ldb/include
 PRIVATE_DEPENDENCIES = LIBTALLOC
 SUBSYSTEM = LIBLDB
@@ -37,7 +37,7 @@ OBJ_FILES = \
 ################################################
 # Start MODULE ldb_paged_results
 [MODULE::ldb_paged_searches]
-INIT_FUNCTION = ldb_paged_searches_init
+INIT_FUNCTION = &ldb_paged_searches_module_ops
 CFLAGS = -Ilib/ldb/include
 PRIVATE_DEPENDENCIES = LIBTALLOC
 SUBSYSTEM = LIBLDB
@@ -52,7 +52,7 @@ OBJ_FILES = \
 SUBSYSTEM = LIBLDB
 CFLAGS = -Ilib/ldb/include
 PRIVATE_DEPENDENCIES = LIBTALLOC
-INIT_FUNCTION = ldb_operational_init
+INIT_FUNCTION = &ldb_operational_module_ops
 OBJ_FILES = \
                modules/operational.o
 # End MODULE ldb_operational
@@ -64,7 +64,7 @@ OBJ_FILES = \
 SUBSYSTEM = LIBLDB
 CFLAGS = -Ilib/ldb/include
 PRIVATE_DEPENDENCIES = LIBTALLOC
-INIT_FUNCTION = ldb_rdn_name_init
+INIT_FUNCTION = &ldb_rdn_name_module_ops
 OBJ_FILES = \
                modules/rdn_name.o
 # End MODULE ldb_rdn_name
@@ -88,7 +88,7 @@ OBJ_FILES = \
 SUBSYSTEM = LIBLDB
 CFLAGS = -Ilib/ldb/include
 PRIVATE_DEPENDENCIES = LIBTALLOC
-INIT_FUNCTION = ldb_skel_init
+INIT_FUNCTION = &ldb_skel_module_ops
 OBJ_FILES = modules/skel.o
 # End MODULE ldb_skel
 ################################################
@@ -99,7 +99,7 @@ OBJ_FILES = modules/skel.o
 SUBSYSTEM = LIBLDB
 CFLAGS = -Ilib/ldb/include
 PRIVATE_DEPENDENCIES = LIBTALLOC SQLITE3 LIBTALLOC
-INIT_FUNCTION = ldb_sqlite3_init
+INIT_FUNCTION = &ldb_sqlite3_module_ops
 OBJ_FILES = \
                ldb_sqlite3/ldb_sqlite3.o
 # End MODULE ldb_sqlite3
@@ -110,7 +110,6 @@ OBJ_FILES = \
 [MODULE::ldb_tdb]
 SUBSYSTEM = LIBLDB
 CFLAGS = -Ilib/ldb/include -Ilib/ldb/ldb_tdb
-INIT_FUNCTION = ldb_tdb_init
 OBJ_FILES = \
                ldb_tdb/ldb_tdb.o \
                ldb_tdb/ldb_search.o \
@@ -131,7 +130,7 @@ SO_VERSION = 0
 OUTPUT_TYPE = SHARED_LIBRARY
 CFLAGS = -Ilib/ldb/include
 PC_FILE = ldb.pc
-INIT_FUNCTION_TYPE = int (*) (void)
+INIT_FUNCTION_TYPE = extern const struct ldb_module_ops
 OBJ_FILES = \
                common/ldb.o \
                common/ldb_ldif.o \
index 01d9ec88ffb12f6c02e3d17f5f1ca4b7f5da5d4e..3062dc886f8f609beb11d7890aa598c51f7f5bfe 100644 (file)
@@ -5,7 +5,6 @@ SUBSYSTEM = LIBLDB
 CFLAGS = -Ilib/ldb/include
 OUTPUT_TYPE = SHARED_LIBRARY
 PRIVATE_DEPENDENCIES = LIBTALLOC LIBCLI_LDAP CREDENTIALS
-INIT_FUNCTION = ldb_ildap_init
 ALIASES = ldapi ldaps ldap
 OBJ_FILES = \
                ldb_ildap.o
index 88ebd13921e2f4259ef1250a43b20b6b9b8646b8..7406e91c9de3ef8921e24a109e672d66ca10e166 100644 (file)
@@ -455,7 +455,7 @@ static int ps_init(struct ldb_module *module)
        return ldb_next_init(module);
 }
 
-const struct ldb_module_ops ldb_pages_searches_module_ops = {
+const struct ldb_module_ops ldb_paged_searches_module_ops = {
        .name           = "paged_searches",
        .search         = ps_search,
        .wait           = ps_wait,
index 199212dbbf1cd4b05702d867cc98daee73bc7b49..e256f41a4db7b93eb77718de65bbbb12fc4cd9e5 100644 (file)
@@ -45,11 +45,6 @@ NSS_STATUS _ldb_nss_init(void)
 
        _ldb_nss_ctx->pid = mypid;
 
-       ret = ldb_global_init();
-       if (ret != 0) {
-               goto failed;
-       }
-
        _ldb_nss_ctx->ldb = ldb_init(_ldb_nss_ctx);
        if (_ldb_nss_ctx->ldb == NULL) {
                goto failed;
index dec8a5f9726056cf90c5c40d4fbd5d59ae3e9c6e..67b16dd06ed0e11a7b283e264a848cb973b5608d 100644 (file)
@@ -656,8 +656,6 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum convert_
        const char *target_str;
        enum convert_target target;
 
-       ldb_global_init();
-
        ctx = talloc_new(NULL);
        ldb = ldb_init(ctx);
 
index 8ee19946158c2b15eb36021baa939493fc49b4d4..c9c77c4e474059a0ad6dba659852744121ef7017 100644 (file)
@@ -80,8 +80,6 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb,
                { NULL }
        };
 
-       ldb_global_init();
-
 #if (_SAMBA_BUILD_ >= 4)
        r = ldb_register_samba_handlers(ldb);
        if (r != 0) {
index d34193b86cb485dfe9b8269e9812c7d2108913bd..4ee66c4fc088b490e55f8d5560a24bab117d7c60 100644 (file)
@@ -88,8 +88,6 @@ int main(int argc, const char **argv)
        int i, ret=0, count=0;
        struct ldb_cmdline *options;
 
-       ldb_global_init();
-
        ldb = ldb_init(NULL);
 
        options = ldb_cmdline_process(ldb, argc, argv, usage);
index fcd0978779c95ae24037b5c4d158fdb7a5fbbee3..184172b22bf554a496450da36e05008dfc087e9d 100644 (file)
@@ -77,8 +77,6 @@ int main(int argc, const char **argv)
        int ret = 0, i;
        struct ldb_cmdline *options;
 
-       ldb_global_init();
-
        ldb = ldb_init(NULL);
 
        options = ldb_cmdline_process(ldb, argc, argv, usage);
index ed98a6d6158fc568b0d4b535ea3013a5a6d45c3a..a9fd064bf8871bc6b97c9346e6b7b88a0f79ac85 100644 (file)
@@ -279,8 +279,6 @@ int main(int argc, const char **argv)
        const char *expression = "(|(objectClass=*)(distinguishedName=*))";
        const char * const * attrs = NULL;
 
-       ldb_global_init();
-
        ldb = ldb_init(NULL);
 
        options = ldb_cmdline_process(ldb, argc, argv, usage);
index ed12380095295d8566c5a2bf8a4dd3b7f81dd719..dd6206b8241aa87c86183e057b616005dffac56f 100644 (file)
@@ -89,8 +89,6 @@ int main(int argc, const char **argv)
        int i, ret=LDB_SUCCESS;
        struct ldb_cmdline *options;
 
-       ldb_global_init();
-
        ldb = ldb_init(NULL);
 
        options = ldb_cmdline_process(ldb, argc, argv, usage);
index c160e87ee4c2c52bf0fa0a69b36a99d7dae9f0b7..b36310a50063c6cc2cfdde44e2674aa73d8ee401 100644 (file)
@@ -56,8 +56,6 @@ int main(int argc, const char **argv)
        struct ldb_cmdline *options;
        struct ldb_dn *dn1, *dn2;
 
-       ldb_global_init();
-
        ldb = ldb_init(NULL);
 
        options = ldb_cmdline_process(ldb, argc, argv, usage);
index 24ceb309639d6b81dc7c29f1cd113d4418aa2e12..e25bd19965b4e265a9bb24d5a770f366a84bd847 100644 (file)
@@ -276,8 +276,6 @@ int main(int argc, const char **argv)
        int ret = -1;
        const char *expression = "(|(objectClass=*)(distinguishedName=*))";
 
-       ldb_global_init();
-
        ldb = ldb_init(NULL);
 
        options = ldb_cmdline_process(ldb, argc, argv, usage);
index 5c21dd3830c37dc2eb111e02ff4af692518b58f2..57a7848733e3c0953adcd692cfd58945ae9229ec 100644 (file)
@@ -393,8 +393,6 @@ int main(int argc, const char **argv)
        TALLOC_CTX *mem_ctx = talloc_new(NULL);
        struct ldb_context *ldb;
 
-       ldb_global_init();
-
        ldb = ldb_init(mem_ctx);
 
        options = ldb_cmdline_process(ldb, argc, argv, usage);
index 7b5f1b835c5033c483f26092ffab4853c3c59825..1846a2c8523e8794fc62ba65475624b1082c91f0 100644 (file)
@@ -560,8 +560,6 @@ static void usage(void)
        struct ldb_cmdline *options;
        FILE *in = stdin;
        FILE *out = stdout;
-       ldb_global_init();
-
        ctx = talloc_new(NULL);
        ldb_ctx = ldb_init(ctx);
 
index a4f2e1cd431ddc03fc4a36c35167165a997e507d..9ed4aa490f3b78eea0793ffc5fa128a6e33dcbec 100644 (file)
@@ -61,8 +61,6 @@ int main(int argc, const char **argv)
                lp_load(lp_ctx, dyn_CONFIGFILE);
        }
 
-       ldb_global_init();
-
        gensec_init(lp_ctx);
        mprSetCtx(mem_ctx);
 
index c256eed96cde60383e4332fdfaac9a89a9abc4cd..dd63ca1ecabd5901a514bed36aba67eb986624d0 100644 (file)
@@ -282,8 +282,6 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
                exit(1);
        }
 
-       ldb_global_init(); /* FIXME: */
-
        share_init();
 
        gensec_init(cmdline_lp_ctx); /* FIXME: */
index 371ddc729771d9e884de7a8666c0bf6cb0cb98b7..4eeea73003c329d4cd05c39d7b587c2703de8e53 100644 (file)
@@ -615,8 +615,6 @@ int main(int argc,char *argv[])
                alarm(max_runtime);
        }
 
-       ldb_global_init();
-
        if (extra_module != NULL) {
            init_module_fn fn = load_module(talloc_autofree_context(), poptGetOptArg(pc));
 
index 2c95e9033dd9b6c9232a6fcdb2485ac9e9cf73dc..e0865c441662a2b328a1d8c83edf5bc7ea1f26ac 100644 (file)
@@ -182,8 +182,6 @@ static int binary_net(int argc, const char **argv)
 
        dcerpc_init();
 
-       ldb_global_init();
-
        mem_ctx = talloc_init("net_context");
        ctx = talloc(mem_ctx, struct net_context);
        if (!ctx) {