don't give errors when an empty modules list is given to ldb
authorAndrew Tridgell <tridge@samba.org>
Thu, 6 Nov 2008 00:13:37 +0000 (11:13 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 6 Nov 2008 00:13:37 +0000 (11:13 +1100)
source4/lib/ldb/common/ldb_modules.c
source4/lib/ldb/include/ldb_private.h

index 2b453bb0c37a2cccea7e9f6eef7103fdb142c5e7..ab0f4c51cc27f62a5cbfe719f62658d1012d8e02 100644 (file)
@@ -40,6 +40,9 @@
 #define LDB_MODULE_PREFIX      "modules:"
 #define LDB_MODULE_PREFIX_LEN  8
 
+static void *ldb_dso_load_symbol(struct ldb_context *ldb, const char *name,
+                                const char *symbol);
+
 void ldb_set_modules_dir(struct ldb_context *ldb, const char *path)
 {
        talloc_free(ldb->modules_dir);
@@ -291,8 +294,8 @@ int ldb_register_module(const struct ldb_module_ops *ops)
        return 0;
 }
 
-void *ldb_dso_load_symbol(struct ldb_context *ldb, const char *name,
-                           const char *symbol)
+static void *ldb_dso_load_symbol(struct ldb_context *ldb, const char *name,
+                                const char *symbol)
 {
        char *path;
        void *handle;
@@ -334,6 +337,10 @@ int ldb_load_modules_list(struct ldb_context *ldb, const char **module_list, str
        for (i = 0; module_list[i] != NULL; i++) {
                struct ldb_module *current;
                const struct ldb_module_ops *ops;
+
+               if (strcmp(module_list[i], "") == 0) {
+                       continue;
+               }
                
                ops = ldb_find_module_ops(module_list[i]);
                if (ops == NULL) {
index 8f7e010bee764bdbcd2c74a002a55dd2eba7a2f3..90c49800173d85f24ad2299f10f44c849c3668dd 100644 (file)
@@ -259,9 +259,6 @@ const char *ldb_default_modules_dir(void);
 
 int ldb_register_backend(const char *url_prefix, ldb_connect_fn);
 
-void *ldb_dso_load_symbol(struct ldb_context *ldb, const char *name,
-                           const char *symbol);
-
 struct ldb_handle *ldb_handle_new(TALLOC_CTX *mem_ctx, struct ldb_context *ldb);
 
 int ldb_module_send_entry(struct ldb_request *req,