From 7bcc0b29662663be75828f2618a5013e7c2c2817 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Oct 2009 11:41:52 +1100 Subject: s4-winsrepl: don't put in attributes with no elements Empty attributes are no longer allowed by ldb. This also fixes the error checking in winsdb_message() This fixes the samba4.nbt.winsreplication test --- source4/nbt_server/wins/winsdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c index 5c3efe2b83..389995e1bc 100644 --- a/source4/nbt_server/wins/winsdb.c +++ b/source4/nbt_server/wins/winsdb.c @@ -794,11 +794,11 @@ static struct ldb_message *winsdb_message(struct ldb_context *ldb, for (i=0;rec->addresses[i];i++) { ret |= ldb_msg_add_winsdb_addr(msg, rec, "address", rec->addresses[i]); } - ret |= ldb_msg_add_empty(msg, "registeredBy", 0, NULL); if (rec->registered_by) { + ret |= ldb_msg_add_empty(msg, "registeredBy", 0, NULL); ret |= ldb_msg_add_string(msg, "registeredBy", rec->registered_by); - if (ret != 0) goto failed; } + if (ret != 0) goto failed; return msg; failed: -- cgit