s4 dns: Add stub checking if updates are allowed
authorKai Blin <kai@samba.org>
Sat, 2 Oct 2010 22:40:32 +0000 (00:40 +0200)
committerKai Blin <kai@samba.org>
Sat, 23 Oct 2010 10:17:06 +0000 (10:17 +0000)
source4/dns_server/dns_update.c

index 72944730a6f2a6a5c2c64bab8808614213443c52..81e3fce5997c46cc81b1dee684534c5e8e2f61ca 100644 (file)
@@ -101,7 +101,8 @@ WERROR dns_server_process_update(struct dns_server *dns,
        struct dns_name_question *zone;
        const struct dns_server_zone *z;
        size_t host_part_len = 0;
-       WERROR werror = WERR_DNS_ERROR_RCODE_NOT_IMPLEMENTED;
+       WERROR werror = DNS_ERR(NOT_IMPLEMENTED);
+       bool update_allowed = false;
 
        if (in->qdcount != 1) {
                return DNS_ERR(FORMAT_ERROR);
@@ -136,5 +137,12 @@ WERROR dns_server_process_update(struct dns_server *dns,
        werror = check_prerequsites(dns, mem_ctx, in, prereqs, prereq_count);
        W_ERROR_NOT_OK_RETURN(werror);
 
+       /* TODO: Check if update is allowed, we probably want "always",
+        * key-based GSSAPI, key-based bind-style TSIG and "never" as
+        * smb.conf options. */
+       if (!update_allowed) {
+               return DNS_ERR(REFUSED);
+       }
+
        return werror;
 }