diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-04-28 15:18:25 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2007-04-28 15:18:25 +0000 |
commit | a002225ee961558144bbd1fcda2152bcc16f29f8 (patch) | |
tree | b3b19abe6a421554d6275d3c1ab1ada2ce9350f5 /source/lib/ldb/common | |
parent | 46005358c589032ad830e5e38de22229c033a4fc (diff) | |
download | samba-a002225ee961558144bbd1fcda2152bcc16f29f8.tar.gz samba-a002225ee961558144bbd1fcda2152bcc16f29f8.tar.xz samba-a002225ee961558144bbd1fcda2152bcc16f29f8.zip |
r22557: Simo has long bugged me that the paths in the sam.ldb partitions were
not relative to the location of the sam.ldb, but instead
lp_private_dir().
This fixes that issue.
Andrew Bartlett
Diffstat (limited to 'source/lib/ldb/common')
-rw-r--r-- | source/lib/ldb/common/ldb.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/lib/ldb/common/ldb.c b/source/lib/ldb/common/ldb.c index c317fe57faf..26213facf2a 100644 --- a/source/lib/ldb/common/ldb.c +++ b/source/lib/ldb/common/ldb.c @@ -231,12 +231,22 @@ struct ldb_dn *ldb_get_default_basedn(struct ldb_context *ldb) int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, const char *options[]) { int ret; - + const char *url2; /* We seem to need to do this here, or else some utilities don't get ldb backends */ ldb_global_init(); ldb->flags = flags; + url2 = talloc_strdup(ldb, url); + if (!url2) { + ldb_oom(ldb); + return LDB_ERR_OPERATIONS_ERROR; + } + ret = ldb_set_opaque(ldb, "ldb_url", talloc_strdup(ldb, url2)); + if (ret != LDB_SUCCESS) { + return ret; + } + ret = ldb_connect_backend(ldb, url, options, &ldb->modules); if (ret != LDB_SUCCESS) { return ret; |