diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-03-28 00:40:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:11:18 -0500 |
commit | a5ee5aae6921b844f142d3a5dd67c188612723d7 (patch) | |
tree | d694f30587082e6dceddf312f25321ad6fa6d209 | |
parent | be6285adadfe7f66fffc4dc7d6de3a2dfef65d2a (diff) | |
download | samba-a5ee5aae6921b844f142d3a5dd67c188612723d7.tar.gz samba-a5ee5aae6921b844f142d3a5dd67c188612723d7.tar.xz samba-a5ee5aae6921b844f142d3a5dd67c188612723d7.zip |
r6087: - remove the dlopen code for now (before it goes back, it needs to be
made into something that isn't a maze of #ifdefs)
- when a module is not found, make it a non-fatal error. Otherwise the standalone ldb
tools just bail out. The previous code meant that if you had a
module listed and it wasn't present then you could _never_ fix it,
as you coudln't open the ldb to remove that module from @MODULES !
(This used to be commit c4728625c093d91e522b80c049e0d42d2b5f143b)
-rw-r--r-- | source4/lib/ldb/common/ldb_modules.c | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c index 40d2cd064a2..ffa150d7738 100644 --- a/source4/lib/ldb/common/ldb_modules.c +++ b/source4/lib/ldb/common/ldb_modules.c @@ -167,13 +167,6 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[]) } for (i = 0; modules[i] != NULL; i++) { -#ifdef HAVE_DLOPEN_DISABLED - void *handle; - ldb_module_init_function init; - struct stat st; - char *filename; - const char *errstr; -#endif struct ldb_module *current; if (strcmp(modules[i], "schema") == 0) { @@ -208,43 +201,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[]) } #endif -#ifdef HAVE_DLOPEN_DISABLED - filename = talloc_asprintf(ldb, "%s.so", modules[i]); - if (!filename) { - ldb_debug(ldb, LDB_DEBUG_FATAL, "Talloc failed!\n"); - return -1; - } - - if (stat(filename, &st) < 0) { - ldb_debug(ldb, LDB_DEBUG_FATAL, "Required module [%s] not found, bailing out!\n", modules[i]); - return -1; - } - - handle = dlopen(filename, RTLD_LAZY); - - if (!handle) { - ldb_debug(ldb, LDB_DEBUG_FATAL, "Error loading module %s [%s]\n", modules[i], dlerror()); - return -1; - } - - init = (ldb_module_init_function)dlsym(handle, "init_module"); - - errstr = dlerror(); - if (errstr) { - ldb_debug(ldb, LDB_DEBUG_FATAL, "Error trying to resolve symbol 'init_module' in %s [%s]\n", modules[i], errstr); - return -1; - } - - current = init(ldb, options); - if (!current) { - ldb_debug(ldb, LDB_DEBUG_FATAL, "function 'init_module' in %s fails\n", modules[i]); - return -1; - } - DLIST_ADD(ldb->modules, current); -#else - ldb_debug(ldb, LDB_DEBUG_FATAL, "Required module [%s] not found, bailing out!\n", modules[i]); - return -1; -#endif + ldb_debug(ldb, LDB_DEBUG_WARNING, "WARNING: Module [%s] not found\n", modules[i]); } talloc_free(modules); |