summaryrefslogtreecommitdiffstats
path: root/server/confdb
diff options
context:
space:
mode:
Diffstat (limited to 'server/confdb')
-rw-r--r--server/confdb/confdb.c15
-rw-r--r--server/confdb/confdb.h5
2 files changed, 7 insertions, 13 deletions
diff --git a/server/confdb/confdb.c b/server/confdb/confdb.c
index 945ac2b82..28f25176c 100644
--- a/server/confdb/confdb.c
+++ b/server/confdb/confdb.c
@@ -26,8 +26,8 @@
#include "ldb.h"
#include "ldb_errors.h"
#include "util/util.h"
+#include "confdb/confdb.h"
#define CONFDB_VERSION "0.1"
-#define CONFDB_FILE "config.ldb"
#define CONFDB_DOMAIN_BASEDN "cn=domains,cn=config"
#define CONFDB_DOMAIN_ATTR "cn"
@@ -530,10 +530,10 @@ done:
int confdb_init(TALLOC_CTX *mem_ctx,
struct event_context *ev,
- struct confdb_ctx **cdb_ctx)
+ struct confdb_ctx **cdb_ctx,
+ char *confdb_location)
{
struct confdb_ctx *cdb;
- char *confdb_location;
int ret;
cdb = talloc_zero(mem_ctx, struct confdb_ctx);
@@ -546,21 +546,12 @@ int confdb_init(TALLOC_CTX *mem_ctx,
return EIO;
}
- confdb_location = talloc_asprintf(cdb,"%s/%s", DB_PATH,CONFDB_FILE);
- if (confdb_location == NULL) {
- talloc_free(cdb);
- return ENOMEM;
- }
- DEBUG(3, ("CONFDB: %s\n",confdb_location));
-
ret = ldb_connect(cdb->ldb, confdb_location, 0, NULL);
if (ret != LDB_SUCCESS) {
talloc_free(cdb);
return EIO;
}
- talloc_free(confdb_location);
-
ret = confdb_test(cdb);
if (ret == ENOENT) {
ret = confdb_init_db(cdb);
diff --git a/server/confdb/confdb.h b/server/confdb/confdb.h
index 62ab45c7d..e6dd0d474 100644
--- a/server/confdb/confdb.h
+++ b/server/confdb/confdb.h
@@ -19,6 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#define CONFDB_FILE "config.ldb"
+
struct confdb_ctx;
int confdb_add_param(struct confdb_ctx *cdb,
@@ -44,7 +46,8 @@ int confdb_get_int(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
int confdb_init(TALLOC_CTX *mem_ctx,
struct event_context *ev,
- struct confdb_ctx **cdb_ctx);
+ struct confdb_ctx **cdb_ctx,
+ char *confdb_location);
int confdb_get_domains(struct confdb_ctx *cdb,
TALLOC_CTX *mem_ctx,