summaryrefslogtreecommitdiff
path: root/source4/wrepl_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-10-14 12:55:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:42:34 -0500
commit676b220f3e8c975824bfdae407e9f7938d79118c (patch)
treed61ecaa11b43e82b5732706eb9ced5d9566785c5 /source4/wrepl_server
parent8755cd4a9ce7ff053c77d51a65a9c91761aea28d (diff)
downloadsamba-676b220f3e8c975824bfdae407e9f7938d79118c.tar.gz
samba-676b220f3e8c975824bfdae407e9f7938d79118c.tar.bz2
samba-676b220f3e8c975824bfdae407e9f7938d79118c.zip
r11040: r10357@SERNOX: metze | 2005-09-20 21:28:11 +0200
- as the old records are broken sinse the last winsdb_dn() changes, (the dn components order was reversed) we can use nicer attribute and objectClass names... - use much more verbose error handling for winsdb_* - print a debug message when we found a corrupted record metze (This used to be commit 82bad3f3efec5b706a65e65054787f1486d7c875)
Diffstat (limited to 'source4/wrepl_server')
-rw-r--r--source4/wrepl_server/wrepl_in_call.c13
-rw-r--r--source4/wrepl_server/wrepl_server.c6
2 files changed, 7 insertions, 12 deletions
diff --git a/source4/wrepl_server/wrepl_in_call.c b/source4/wrepl_server/wrepl_in_call.c
index ab86aa209f..4472a0fede 100644
--- a/source4/wrepl_server/wrepl_in_call.c
+++ b/source4/wrepl_server/wrepl_in_call.c
@@ -263,8 +263,8 @@ static NTSTATUS wreplsrv_in_send_request(struct wreplsrv_in_call *call)
return NT_STATUS_OK;
}
- filter = talloc_asprintf(call, "(&(winsOwner=%s)(objectClass=wins)(active=1)(version>=%llu)(version<=%llu))",
- owner->owner.address, owner_in->min_version, owner_in->max_version);
+ filter = talloc_asprintf(call, "(&(winsOwner=%s)(objectClass=winsRecord)(state>=%u)(versionID>=%llu)(versionID<=%llu))",
+ owner->owner.address, WINS_REC_ACTIVE, owner_in->min_version, owner_in->max_version);
NT_STATUS_HAVE_NO_MEMORY(filter);
ret = ldb_search(service->wins_db, NULL, LDB_SCOPE_SUBTREE, filter, NULL, &res);
if (res != NULL) {
@@ -277,13 +277,8 @@ static NTSTATUS wreplsrv_in_send_request(struct wreplsrv_in_call *call)
NT_STATUS_HAVE_NO_MEMORY(names);
for (i=0; i < ret; i++) {
- rec = winsdb_record(res[i], call);
- NT_STATUS_HAVE_NO_MEMORY(rec);
-
- rec->name = winsdb_nbt_name(names, res[i]->dn);
- if (!rec->name) {
- return NT_STATUS_INTERNAL_DB_CORRUPTION;
- }
+ status = winsdb_record(res[i], NULL, call, &rec);
+ NT_STATUS_NOT_OK_RETURN(status);
status = wreplsrv_record2wins_name(names, &names[i], rec);
NT_STATUS_NOT_OK_RETURN(status);
diff --git a/source4/wrepl_server/wrepl_server.c b/source4/wrepl_server/wrepl_server.c
index 866090f400..dd49b37d78 100644
--- a/source4/wrepl_server/wrepl_server.c
+++ b/source4/wrepl_server/wrepl_server.c
@@ -205,13 +205,13 @@ static NTSTATUS wreplsrv_load_table(struct wreplsrv_service *service)
uint64_t version;
const char * const attrs[] = {
"winsOwner",
- "version",
+ "versionID",
NULL
};
/* find the record in the WINS database */
ret = ldb_search(service->wins_db, NULL, LDB_SCOPE_SUBTREE,
- "(objectClass=wins)", attrs, &res);
+ "(objectClass=winsRecord)", attrs, &res);
if (res != NULL) {
talloc_steal(tmp_ctx, res);
}
@@ -221,7 +221,7 @@ static NTSTATUS wreplsrv_load_table(struct wreplsrv_service *service)
for (i=0; i < ret; i++) {
wins_owner = ldb_msg_find_string(res[i], "winsOwner", NULL);
- version = ldb_msg_find_uint64(res[i], "version", 0);
+ version = ldb_msg_find_uint64(res[i], "versionID", 0);
if (wins_owner) {
status = wreplsrv_add_table(service,