samba.tests.dns_aging.+test_dns_add_sibling_2_7_days_aging_touch
samba.tests.dns_aging.+test_dns_add_sibling_2_7_days_no_aging_touch
samba.tests.dns_aging.+test_add_update_dwFlags
-samba.tests.dns_aging.+test_add_update_dwReserved
samba.tests.dns_aging.+test_add_update_dwSerial
samba.tests.dns_aging.+test_add_update_dwSerial_2
samba.tests.dns_aging.+test_add_update_many
}
if (dns_record_match(drec, &rec2)) {
+ /*
+ * we are replacing this one with arec, which is done
+ * by pushing arec into el->values[i] below, after the
+ * various manipulations.
+ */
break;
}
}
return WERR_DNS_ERROR_RECORD_DOES_NOT_EXIST;
}
- /* If updating SOA record, use specified serial, otherwise increment */
+ /*
+ * If we're updating a SOA record, use the specified serial.
+ *
+ * Otherwise, if we are updating ttl in place (i.e., not changing
+ * .wType and .data on a record), we should increment the existing
+ * serial, and save to the SOA.
+ *
+ * Outside of those two cases, we look for the zone's SOA record and
+ * use its serial.
+ */
if (arec->wType != DNS_TYPE_SOA) {
- serial = dnsserver_update_soa(mem_ctx, samdb, z, &werr);
- if (serial < 0) {
- return werr;
+ if (updating_ttl) {
+ /*
+ * In this case, we keep some of the old values.
+ */
+ arec->dwSerial = rec2.dwSerial;
+ arec->dwReserved = rec2.dwReserved;
+ /*
+ * TODO: if the old TTL and the new TTL are
+ * different, the serial number is incremented.
+ */
+ } else {
+ arec->dwReserved = 0;
+ serial = dnsserver_update_soa(mem_ctx, samdb, z, &werr);
+ if (serial < 0) {
+ return werr;
+ }
+ arec->dwSerial = serial;
}
- arec->dwSerial = serial;
}
/* Set the correct rank for the record. */