summaryrefslogtreecommitdiff
path: root/source4/wrepl_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-12-30 20:08:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:49:05 -0500
commit0391b1cb3a1527aed5beefbdda67a6ce5062bbab (patch)
treeff995fa2d5056d0b7c44fa09965fd10eb7e1839c /source4/wrepl_server
parenteef64ba0344f2a6ff95bbe09a213f9bc8751b020 (diff)
downloadsamba-0391b1cb3a1527aed5beefbdda67a6ce5062bbab.tar.gz
samba-0391b1cb3a1527aed5beefbdda67a6ce5062bbab.tar.bz2
samba-0391b1cb3a1527aed5beefbdda67a6ce5062bbab.zip
r12617: create a winsdb_handle and pass that arround,
so we later can hang the local owner address, on this handle too metze (This used to be commit 49ba4cc11144671cafcbe2967954bfd786ea6e76)
Diffstat (limited to 'source4/wrepl_server')
-rw-r--r--source4/wrepl_server/wrepl_in_call.c2
-rw-r--r--source4/wrepl_server/wrepl_scavenging.c6
-rw-r--r--source4/wrepl_server/wrepl_server.c5
-rw-r--r--source4/wrepl_server/wrepl_server.h2
4 files changed, 8 insertions, 7 deletions
diff --git a/source4/wrepl_server/wrepl_in_call.c b/source4/wrepl_server/wrepl_in_call.c
index ebcd4f5d83..a2637d1b39 100644
--- a/source4/wrepl_server/wrepl_in_call.c
+++ b/source4/wrepl_server/wrepl_in_call.c
@@ -244,7 +244,7 @@ static NTSTATUS wreplsrv_in_send_request(struct wreplsrv_in_call *call)
(long long)owner_in->min_version,
(long long)owner_in->max_version);
NT_STATUS_HAVE_NO_MEMORY(filter);
- ret = ldb_search(service->wins_db, NULL, LDB_SCOPE_SUBTREE, filter, NULL, &res);
+ ret = ldb_search(service->wins_db->ldb, NULL, LDB_SCOPE_SUBTREE, filter, NULL, &res);
if (ret != LDB_SUCCESS) return NT_STATUS_INTERNAL_DB_CORRUPTION;
talloc_steal(call, res);
if (res->count == 0) {
diff --git a/source4/wrepl_server/wrepl_scavenging.c b/source4/wrepl_server/wrepl_scavenging.c
index e450b66ed8..bc25354e3c 100644
--- a/source4/wrepl_server/wrepl_scavenging.c
+++ b/source4/wrepl_server/wrepl_scavenging.c
@@ -53,7 +53,7 @@ static NTSTATUS wreplsrv_scavenging_owned_records(struct wreplsrv_service *servi
"(expireTime<=%s)(!(isStatic=1)))",
WINSDB_OWNER_LOCAL, now_timestr);
NT_STATUS_HAVE_NO_MEMORY(filter);
- ret = ldb_search(service->wins_db, NULL, LDB_SCOPE_SUBTREE, filter, NULL, &res);
+ ret = ldb_search(service->wins_db->ldb, NULL, LDB_SCOPE_SUBTREE, filter, NULL, &res);
if (ret != LDB_SUCCESS) return NT_STATUS_INTERNAL_DB_CORRUPTION;
talloc_steal(tmp_mem, res);
@@ -161,7 +161,7 @@ static NTSTATUS wreplsrv_scavenging_replica_non_active_records(struct wreplsrv_s
"(!(recordState=%u))(expireTime<=%s)(!(isStatic=1)))",
WINSDB_OWNER_LOCAL, WREPL_STATE_ACTIVE, now_timestr);
NT_STATUS_HAVE_NO_MEMORY(filter);
- ret = ldb_search(service->wins_db, NULL, LDB_SCOPE_SUBTREE, filter, NULL, &res);
+ ret = ldb_search(service->wins_db->ldb, NULL, LDB_SCOPE_SUBTREE, filter, NULL, &res);
if (ret != LDB_SUCCESS) return NT_STATUS_INTERNAL_DB_CORRUPTION;
talloc_steal(tmp_mem, res);
@@ -264,7 +264,7 @@ static NTSTATUS wreplsrv_scavenging_replica_active_records(struct wreplsrv_servi
"(recordState=%u)(expireTime<=%s)(!(isStatic=1)))",
WINSDB_OWNER_LOCAL, WREPL_STATE_ACTIVE, now_timestr);
NT_STATUS_HAVE_NO_MEMORY(filter);
- ret = ldb_search(service->wins_db, NULL, LDB_SCOPE_SUBTREE, filter, NULL, &res);
+ ret = ldb_search(service->wins_db->ldb, NULL, LDB_SCOPE_SUBTREE, filter, NULL, &res);
if (ret != LDB_SUCCESS) return NT_STATUS_INTERNAL_DB_CORRUPTION;
talloc_steal(tmp_mem, res);
diff --git a/source4/wrepl_server/wrepl_server.c b/source4/wrepl_server/wrepl_server.c
index 5f182cd513..2682ca6721 100644
--- a/source4/wrepl_server/wrepl_server.c
+++ b/source4/wrepl_server/wrepl_server.c
@@ -172,7 +172,7 @@ BOOL wreplsrv_is_our_address(struct wreplsrv_service *service, const char *addre
uint64_t wreplsrv_local_max_version(struct wreplsrv_service *service)
{
int ret;
- struct ldb_context *ldb = service->wins_db;
+ struct ldb_context *ldb = service->wins_db->ldb;
struct ldb_dn *dn;
struct ldb_result *res = NULL;
TALLOC_CTX *tmp_ctx = talloc_new(service);
@@ -306,6 +306,7 @@ static NTSTATUS wreplsrv_load_table(struct wreplsrv_service *service)
int ret;
NTSTATUS status;
TALLOC_CTX *tmp_ctx = talloc_new(service);
+ struct ldb_context *ldb = service->wins_db->ldb;
int i;
const char *wins_owner;
uint64_t version;
@@ -316,7 +317,7 @@ static NTSTATUS wreplsrv_load_table(struct wreplsrv_service *service)
};
/* find the record in the WINS database */
- ret = ldb_search(service->wins_db, NULL, LDB_SCOPE_SUBTREE,
+ ret = ldb_search(ldb, NULL, LDB_SCOPE_SUBTREE,
"(objectClass=winsRecord)", attrs, &res);
status = NT_STATUS_INTERNAL_DB_CORRUPTION;
if (ret != LDB_SUCCESS) goto failed;
diff --git a/source4/wrepl_server/wrepl_server.h b/source4/wrepl_server/wrepl_server.h
index fabba09389..48378fe152 100644
--- a/source4/wrepl_server/wrepl_server.h
+++ b/source4/wrepl_server/wrepl_server.h
@@ -213,7 +213,7 @@ struct wreplsrv_service {
struct timeval startup_time;
/* the winsdb handle */
- struct ldb_context *wins_db;
+ struct winsdb_handle *wins_db;
/* some configuration */
struct {