summaryrefslogtreecommitdiff
path: root/server/confdb
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2008-11-24 11:23:10 -0500
committerSimo Sorce <idra@samba.org>2008-11-24 17:44:37 -0500
commit8c77f1f01f16c05cd8867584b5acf181ef8ce9e0 (patch)
treedaea5886d40b14cf6becb33da266bdc334331665 /server/confdb
parent98bf10fa12c08463a1f625403c4621f1bbeb0bcc (diff)
downloadsssd-8c77f1f01f16c05cd8867584b5acf181ef8ce9e0.tar.gz
sssd-8c77f1f01f16c05cd8867584b5acf181ef8ce9e0.tar.bz2
sssd-8c77f1f01f16c05cd8867584b5acf181ef8ce9e0.zip
Replacing hard-coded paths with configure script substitutions.
Changing the default SBUS locations to be configure script parameters
Diffstat (limited to 'server/confdb')
-rw-r--r--server/confdb/confdb.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/server/confdb/confdb.c b/server/confdb/confdb.c
index 3064101a..7d11fae7 100644
--- a/server/confdb/confdb.c
+++ b/server/confdb/confdb.c
@@ -20,13 +20,14 @@
*/
#define _GNU_SOURCE
+#include "config.h"
#include <string.h>
#include <errno.h>
#include "ldb.h"
#include "ldb_errors.h"
#include "util/util.h"
#define CONFDB_VERSION "0.1"
-#define CONFDB_FILE "/var/lib/sss/db/config.ldb"
+#define CONFDB_FILE "config.ldb"
#define CONFDB_DOMAIN_BASEDN "cn=domains,cn=config"
#define CONFDB_DOMAIN_ATTR "cn"
@@ -417,6 +418,7 @@ int confdb_init(TALLOC_CTX *mem_ctx,
struct confdb_ctx **cdb_ctx)
{
struct confdb_ctx *cdb;
+ char *confdb_location;
int ret;
cdb = talloc_zero(mem_ctx, struct confdb_ctx);
@@ -429,12 +431,21 @@ int confdb_init(TALLOC_CTX *mem_ctx,
return EIO;
}
- ret = ldb_connect(cdb->ldb, CONFDB_FILE, 0, NULL);
+ 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);