summaryrefslogtreecommitdiffstats
path: root/source4/dns_server/dnsserver_common.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source4/dns_server/dnsserver_common.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/source4/dns_server/dnsserver_common.c b/source4/dns_server/dnsserver_common.c
index fbe39d9..88aed2e 100644
--- a/source4/dns_server/dnsserver_common.c
+++ b/source4/dns_server/dnsserver_common.c
@@ -68,6 +68,8 @@ uint8_t werr_to_dns_err(WERROR werr)
return DNS_RCODE_NOTZONE;
} else if (W_ERROR_EQUAL(DNS_ERR(BADKEY), werr)) {
return DNS_RCODE_BADKEY;
+ } else if (W_ERROR_EQUAL(WERR_ACCESS_DENIED, werr)) {
+ return DNS_RCODE_REFUSED;
}
DEBUG(5, ("No mapping exists for %s\n", win_errstr(werr)));
return DNS_RCODE_SERVFAIL;
@@ -642,7 +644,7 @@ static int rec_cmp(const struct dnsp_DnssrvRpcRecord *r1,
* The records are sorted with higher types first,
* which puts tombstones (type 0) last.
*/
- return r2->wType - r1->wType;
+ return NUMERIC_CMP(r2->wType, r1->wType);
}
/*
* Then we need to sort from the oldest to newest timestamp.
@@ -650,7 +652,7 @@ static int rec_cmp(const struct dnsp_DnssrvRpcRecord *r1,
* Note that dwTimeStamp == 0 (never expiring) records come first,
* then the ones whose expiry is soonest.
*/
- return r1->dwTimeStamp - r2->dwTimeStamp;
+ return NUMERIC_CMP(r1->dwTimeStamp, r2->dwTimeStamp);
}
/*
@@ -1034,10 +1036,11 @@ WERROR dns_common_replace(struct ldb_context *samdb,
* record.
*/
if (records[i].data.EntombedTime != 0) {
- if (rec_count != 1) {
- DBG_ERR("tombstone record has %u neighbour "
- "records.\n",
- rec_count - 1);
+ if (rec_count != 1 && DEBUGLVL(DBGLVL_NOTICE)) {
+ DBG_NOTICE("tombstone record [%u] has "
+ "%u neighbour records.\n",
+ i, rec_count - 1);
+ NDR_PRINT_DEBUG(dnsp_DnssrvRpcRecord, &records[i]);
}
was_tombstoned = true;
}
@@ -1407,7 +1410,7 @@ static int dns_common_sort_zones(struct ldb_message **m1, struct ldb_message **m
/* If the string lengths are not equal just sort by length */
if (l1 != l2) {
/* If m1 is the larger zone name, return it first */
- return l2 - l1;
+ return NUMERIC_CMP(l2, l1);
}
/*TODO: We need to compare DNs here, we want the DomainDNSZones first */