svn commit: samba r6087 - in branches/SAMBA_4_0/source/lib/ldb/common: .

tridge at samba.org tridge at samba.org
Mon Mar 28 00:40:18 GMT 2005


Author: tridge
Date: 2005-03-28 00:40:18 +0000 (Mon, 28 Mar 2005)
New Revision: 6087

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6087

Log:
- 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 !

Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c	2005-03-28 00:37:27 UTC (rev 6086)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c	2005-03-28 00:40:18 UTC (rev 6087)
@@ -167,13 +167,6 @@
 	}
 
 	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 @@
 		}
 #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);



More information about the samba-cvs mailing list