summaryrefslogtreecommitdiff
path: root/source4/nbt_server
diff options
context:
space:
mode:
Diffstat (limited to 'source4/nbt_server')
-rw-r--r--source4/nbt_server/wins/winsdb.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c
index 72dbd77959..0608575db2 100644
--- a/source4/nbt_server/wins/winsdb.c
+++ b/source4/nbt_server/wins/winsdb.c
@@ -562,12 +562,7 @@ NTSTATUS winsdb_record(struct winsdb_handle *h, struct ldb_message *msg, TALLOC_
}
rec->addresses[i] = NULL;
- if (rec->is_static) {
- if (num_values < 1) {
- status = NT_STATUS_INTERNAL_DB_CORRUPTION;
- goto failed;
- }
- rec->state = WREPL_STATE_ACTIVE;
+ if (rec->is_static && rec->state == WREPL_STATE_ACTIVE) {
rec->expire_time = get_time_t_max();
for (i=0;rec->addresses[i];i++) {
rec->addresses[i]->expire_time = rec->expire_time;
@@ -594,10 +589,9 @@ struct ldb_message *winsdb_message(struct ldb_context *ldb,
size_t addr_count;
const char *expire_time;
struct ldb_message *msg = ldb_msg_new(mem_ctx);
- if (msg == NULL) goto failed;
+ if (msg == NULL) goto failed;
- if (rec->is_static) {
- rec->state = WREPL_STATE_ACTIVE;
+ if (rec->is_static && rec->state == WREPL_STATE_ACTIVE) {
rec->expire_time = get_time_t_max();
for (i=0;rec->addresses[i];i++) {
rec->addresses[i]->expire_time = rec->expire_time;