summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-12-23 16:15:26 +1100
committerAmitay Isaacs <amitay@samba.org>2011-12-23 07:56:34 +0100
commit271c7d9251059c38a815ad47034bc478752a0167 (patch)
tree5813f73292c24c99901eb8295feebf638f5708e3
parent809092a7adcb884492dda12796f270f9bec7ab89 (diff)
downloadsamba-271c7d9251059c38a815ad47034bc478752a0167.tar.gz
samba-271c7d9251059c38a815ad47034bc478752a0167.tar.bz2
samba-271c7d9251059c38a815ad47034bc478752a0167.zip
s4:rpc-dnsserver: Set the rank for the new DNS record correctly
Autobuild-User: Amitay Isaacs <amitay@samba.org> Autobuild-Date: Fri Dec 23 07:56:34 CET 2011 on sn-devel-104
-rw-r--r--source4/rpc_server/dnsserver/dnsdb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/rpc_server/dnsserver/dnsdb.c b/source4/rpc_server/dnsserver/dnsdb.c
index 2f55404a4e..9bf5ecf5ac 100644
--- a/source4/rpc_server/dnsserver/dnsdb.c
+++ b/source4/rpc_server/dnsserver/dnsdb.c
@@ -404,6 +404,14 @@ WERROR dnsserver_db_add_record(TALLOC_CTX *mem_ctx,
rec = dns_to_dnsp_copy(mem_ctx, add_record);
W_ERROR_HAVE_NO_MEMORY(rec);
+ /* Set the correct rank for the record.
+ * FIXME: add logic to check for glue records */
+ if (z->zoneinfo->dwZoneType == DNS_ZONE_TYPE_PRIMARY) {
+ rec->rank |= DNS_RANK_ZONE;
+ } else if (strcmp(z->name, ".") == 0) {
+ rec->rank |= DNS_RANK_ROOT_HINT;
+ }
+
serial = dnsserver_update_soa(mem_ctx, samdb, z);
if (serial < 0) {
return WERR_INTERNAL_DB_ERROR;