summaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index e222c8be..521ae9d2 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -25,11 +25,14 @@
#include "confdb/confdb.h"
#include <time.h>
+#define LDB_MODULES_PATH "LDB_MODULES_PATH"
+
static errno_t sysdb_ldb_connect(TALLOC_CTX *mem_ctx, const char *filename,
struct ldb_context **_ldb)
{
int ret;
struct ldb_context *ldb;
+ const char *mod_path;
if (_ldb == NULL) {
return EINVAL;
@@ -45,6 +48,12 @@ static errno_t sysdb_ldb_connect(TALLOC_CTX *mem_ctx, const char *filename,
return EIO;
}
+ mod_path = getenv(LDB_MODULES_PATH);
+ if (mod_path != NULL) {
+ DEBUG(9, ("Setting ldb module path to [%s].\n", mod_path));
+ ldb_set_modules_dir(ldb, mod_path);
+ }
+
ret = ldb_connect(ldb, filename, 0, NULL);
if (ret != LDB_SUCCESS) {
return EIO;