summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-04 20:13:17 +1100
committerAndrew Tridgell <tridge@samba.org>2010-11-04 20:35:44 +1100
commit1ab7bd1bfbfe5a27c91315d98c4e4949608d83e9 (patch)
treef6079ff221bfc96ea2e6ae51baf77cf58e379d5e /source4
parent6a22d8938c36de8e8a6e99eadca896bdb9802b1d (diff)
downloadsamba-1ab7bd1bfbfe5a27c91315d98c4e4949608d83e9.tar.gz
samba-1ab7bd1bfbfe5a27c91315d98c4e4949608d83e9.tar.bz2
samba-1ab7bd1bfbfe5a27c91315d98c4e4949608d83e9.zip
s4-ldb: don't load modules from the same directory twice
this prevents samba dying if you do a 'make install' while it is running. Otherwise the make install changes the inode numbers of the modules in the modules directory, causing them to reload, which causes multiple modules of the same name to try and load
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/common/ldb_modules.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index 1457298798..96e3fed7eb 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -844,7 +844,7 @@ static int ldb_modules_load_dir(const char *modules_dir, const char *version);
from the first ldb_init() is just a convenient way to ensure it is
called early enough.
*/
-static int ldb_modules_load_one(const char *path, const char *version)
+static int ldb_modules_load_path(const char *path, const char *version)
{
void *handle;
int (*init_fn)(const char *);
@@ -969,7 +969,7 @@ static int ldb_modules_load_dir(const char *modules_dir, const char *version)
TYPESAFE_QSORT(modlist, num_modules, qsort_string);
for (i=0; i<num_modules; i++) {
- int ret = ldb_modules_load_one(modlist[i], version);
+ int ret = ldb_modules_load_path(modlist[i], version);
if (ret != LDB_SUCCESS) {
fprintf(stderr, "ldb: failed to initialise module %s : %s\n",
modlist[i], ldb_strerror(ret));
@@ -988,7 +988,7 @@ static int ldb_modules_load_dir(const char *modules_dir, const char *version)
*/
void ldb_set_modules_dir(struct ldb_context *ldb, const char *path)
{
- int ret = ldb_modules_load_dir(path, LDB_VERSION);
+ int ret = ldb_modules_load_path(path, LDB_VERSION);
if (ret != LDB_SUCCESS) {
ldb_asprintf_errstring(ldb, "Failed to load modules from: %s\n", path);
}
@@ -1045,7 +1045,7 @@ int ldb_modules_load(const char *modules_path, const char *version)
for (tok=strtok_r(path, ":", &tok_ptr);
tok;
tok=strtok_r(NULL, ":", &tok_ptr)) {
- ret = ldb_modules_load_dir(tok, version);
+ ret = ldb_modules_load_path(tok, version);
if (ret != LDB_SUCCESS) {
talloc_free(path);
return ret;