From 79f6bcd5ae1711075ce0e75392ce83a72766698e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 23 Mar 2005 01:30:43 +0000 Subject: r5988: Fix the -P option (use machine account credentials) to use the Samba4 secrets system, and not the old system from Samba3. This allowed the code from auth_domain to be shared - we now only lookup the secrets.ldb in lib/credentials.c. In order to link the resultant binary, samdb_search() has been moved from deep inside rpc_server into lib/gendb.c, along with the existing gendb_search_v(). The vast majority of this patch is the simple rename that followed, (Depending on the whole SAMDB for just this function seemed pointless, and brought in futher dependencies, such as smbencrypt.c). Andrew Bartlett (This used to be commit e13c671619bd290a8b3cae8555cb281a9a185ee0) --- source4/dsdb/samdb/samdb.c | 22 +--------------------- source4/dsdb/samdb/samdb_privilege.c | 2 +- 2 files changed, 2 insertions(+), 22 deletions(-) (limited to 'source4/dsdb') diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c index 4cebcfc692..6f9251dd32 100644 --- a/source4/dsdb/samdb/samdb.c +++ b/source4/dsdb/samdb/samdb.c @@ -36,26 +36,6 @@ struct ldb_context *samdb_connect(TALLOC_CTX *mem_ctx) return ldb_wrap_connect(mem_ctx, lp_sam_url(), 0, NULL); } -/* - search the sam for the specified attributes - varargs variant -*/ -int samdb_search(struct ldb_context *sam_ldb, - TALLOC_CTX *mem_ctx, - const char *basedn, - struct ldb_message ***res, - const char * const *attrs, - const char *format, ...) _PRINTF_ATTRIBUTE(6,7) -{ - va_list ap; - int count; - - va_start(ap, format); - count = gendb_search_v(sam_ldb, mem_ctx, basedn, res, attrs, format, ap); - va_end(ap); - - return count; -} - /* search the sam for the specified attributes in a specific domain, filter on objectSid being in domain_sid. @@ -585,7 +565,7 @@ int samdb_copy_template(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, /* pull the template record */ - ret = samdb_search(sam_ldb, mem_ctx, NULL, &res, NULL, "%s", expression); + ret = gendb_search(sam_ldb, mem_ctx, NULL, &res, NULL, "%s", expression); if (ret != 1) { DEBUG(1,("samdb: ERROR: template '%s' matched %d records\n", expression, ret)); diff --git a/source4/dsdb/samdb/samdb_privilege.c b/source4/dsdb/samdb/samdb_privilege.c index 08435e2731..77ddcbbdcd 100644 --- a/source4/dsdb/samdb/samdb_privilege.c +++ b/source4/dsdb/samdb/samdb_privilege.c @@ -44,7 +44,7 @@ static NTSTATUS samdb_privilege_setup_sid(void *samctx, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - ret = samdb_search(samctx, mem_ctx, NULL, &res, attrs, "objectSid=%s", sidstr); + ret = gendb_search(samctx, mem_ctx, NULL, &res, attrs, "objectSid=%s", sidstr); if (ret != 1) { talloc_free(sidstr); /* not an error to not match */ -- cgit