1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

dns/dlz: remember old timestamp for dynamic records

If we don't tell dns_common_replace() the old timestamp, it will
think the node is static because the timestamp is 0.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15040

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2022-04-13 15:20:50 +12:00 committed by Andrew Bartlett
parent 590d2e169c
commit f1017c6f2d
2 changed files with 11 additions and 2 deletions

View File

@ -1 +0,0 @@
samba4.dlz_bind9.aging

View File

@ -1961,7 +1961,6 @@ _PUBLIC_ isc_result_t dlz_addrdataset(const char *name, const char *rdatastr, vo
} else {
rec->dwTimeStamp = unix_to_dns_timestamp(time(NULL));
}
/* adding space for a new value */
recs = talloc_realloc(rec, recs,
struct dnsp_DnssrvRpcRecord,
@ -1972,6 +1971,17 @@ _PUBLIC_ isc_result_t dlz_addrdataset(const char *name, const char *rdatastr, vo
goto exit;
}
num_recs++;
} else {
/*
* We are updating a record. Depending on whether aging is
* enabled, and how old the old timestamp is,
* dns_common_replace() will work out whether to bump the
* timestamp or not. But to do that, we need to tell it the
* old timestamp.
*/
if (! dns_name_is_static(recs, num_recs)) {
rec->dwTimeStamp = recs[i].dwTimeStamp;
}
}
recs[i] = *rec;