s4:rpc-dnsserver: Set the rank for the new DNS record correctly
authorAmitay Isaacs <amitay@gmail.com>
Fri, 23 Dec 2011 05:15:26 +0000 (16:15 +1100)
committerAmitay Isaacs <amitay@samba.org>
Fri, 23 Dec 2011 06:56:34 +0000 (07:56 +0100)
Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Fri Dec 23 07:56:34 CET 2011 on sn-devel-104

source4/rpc_server/dnsserver/dnsdb.c

index 2f55404a4ebdeb81d6368e1f566c5ca053359ec9..9bf5ecf5ac5c285070352dc32ce14f6c9b5a6045 100644 (file)
@@ -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;