sssd/0008-Check-LDB_MODULES_PATH-for-sysdb.patch
2011-02-21 16:29:46 -05:00

45 lines
1.2 KiB
Diff

From abff4fc9865cb99fca24f0c0402d59296bd4fad9 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose@redhat.com>
Date: Mon, 14 Feb 2011 16:56:25 +0100
Subject: [PATCH 8/8] Check LDB_MODULES_PATH for sysdb
---
src/db/sysdb.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index 670b58727a8d795d8b837026ef78a94aaec0e174..570835be838fed2647f34634a36ecaebc3ecbe4e 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;
--
1.7.4