diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-06-26 00:12:44 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:48 -0500 |
commit | 8c53aba485e7986baacf91b2c99ef7999142aee4 (patch) | |
tree | b615503de3ef8a222ba95d5dd8a591d71cf7653f /source4/lib/db_wrap.c | |
parent | b3e493470f3465cfe5cfa958b019ac8cfb8f12f2 (diff) | |
download | samba-8c53aba485e7986baacf91b2c99ef7999142aee4.tar.gz samba-8c53aba485e7986baacf91b2c99ef7999142aee4.tar.bz2 samba-8c53aba485e7986baacf91b2c99ef7999142aee4.zip |
r7912: make private_path() recognise a non-relative filename, so we can have
sam database = sam.ldb
and it will know to put it in the private dir, but if you use
sam database = ldap://server
it knows to use it as-is
(This used to be commit c5bccbc366db144d3e1cb7b21f0e3284d841dd06)
Diffstat (limited to 'source4/lib/db_wrap.c')
-rw-r--r-- | source4/lib/db_wrap.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source4/lib/db_wrap.c b/source4/lib/db_wrap.c index b000225bbf..c0240aa62d 100644 --- a/source4/lib/db_wrap.c +++ b/source4/lib/db_wrap.c @@ -83,7 +83,7 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx, struct ldb_wrap *w; int ret; struct event_context *ev; - + char *real_url = NULL; for (w = ldb_list; w; w = w->next) { if (strcmp(url, w->url) == 0) { @@ -112,13 +112,21 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx, talloc_free(ldb); return NULL; } + + real_url = private_path(ldb, url); + if (real_url == NULL) { + talloc_free(ldb); + return NULL; + } - ret = ldb_connect(ldb, url, flags, options); + ret = ldb_connect(ldb, real_url, flags, options); if (ret == -1) { talloc_free(ldb); return NULL; } + talloc_free(real_url); + w = talloc(ldb, struct ldb_wrap); if (w == NULL) { talloc_free(ldb); |