summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-04-28 15:18:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:51:43 -0500
commitf34c57f4fc1a1817735ddb653011e6deb0edf912 (patch)
tree2582876276ed24bd2e88090886204d53168cbed3 /source4/lib/ldb
parentb006d86e659b318bb73360cd537905e2cd801992 (diff)
downloadsamba-f34c57f4fc1a1817735ddb653011e6deb0edf912.tar.gz
samba-f34c57f4fc1a1817735ddb653011e6deb0edf912.tar.bz2
samba-f34c57f4fc1a1817735ddb653011e6deb0edf912.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 (This used to be commit c0fd6f63399d55a1938e31ae7b10689cc02ff2fa)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/common/ldb.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index c317fe57fa..26213facf2 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/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;