summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-08-12 15:43:04 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-13 12:30:50 +1000
commitae65b971ac1492da53b1259d113f686504e570cd (patch)
tree1b6b3864a05ce4e96212c68360f5b0c60669dfce /source4/dsdb/samdb
parent8e4e408e3a96c0fb5540d2f9a99269c09226e4a4 (diff)
downloadsamba-ae65b971ac1492da53b1259d113f686504e570cd.tar.gz
samba-ae65b971ac1492da53b1259d113f686504e570cd.tar.bz2
samba-ae65b971ac1492da53b1259d113f686504e570cd.zip
s4-dsdb: Provide additional method to connect to specified database path
samdb_connect() now calls samdb_connect_url() with default "sam.ldb". Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/samdb.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c
index d761107b15..cfbca40220 100644
--- a/source4/dsdb/samdb/samdb.c
+++ b/source4/dsdb/samdb/samdb.c
@@ -89,22 +89,20 @@ struct cli_credentials *samdb_credentials(struct loadparm_context *lp_ctx)
}
/*
- connect to the SAM database
+ connect to the SAM database specified by URL
return an opaque context pointer on success, or NULL on failure
*/
-struct ldb_context *samdb_connect(TALLOC_CTX *mem_ctx,
+struct ldb_context *samdb_connect_url(TALLOC_CTX *mem_ctx,
struct tevent_context *ev_ctx,
struct loadparm_context *lp_ctx,
struct auth_session_info *session_info,
- unsigned int flags)
+ unsigned int flags, const char *url)
{
struct ldb_context *ldb;
struct dsdb_schema *schema;
- const char *url;
struct cli_credentials *credentials;
int ret;
- url = "sam.ldb";
credentials = samdb_credentials(lp_ctx);
ldb = ldb_wrap_find(url, ev_ctx, lp_ctx, session_info, credentials, flags);
@@ -139,6 +137,19 @@ struct ldb_context *samdb_connect(TALLOC_CTX *mem_ctx,
}
+/*
+ connect to the SAM database
+ return an opaque context pointer on success, or NULL on failure
+ */
+struct ldb_context *samdb_connect(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev_ctx,
+ struct loadparm_context *lp_ctx,
+ struct auth_session_info *session_info,
+ unsigned int flags)
+{
+ return samdb_connect_url(mem_ctx, ev_ctx, lp_ctx, session_info, flags, "sam.ldb");
+}
+
/****************************************************************************
Create the SID list for this user.
****************************************************************************/