summaryrefslogtreecommitdiff
path: root/source4/dns_server
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2010-10-11 23:50:16 +0200
committerKai Blin <kai@samba.org>2010-10-23 10:17:06 +0000
commitcebce2b9a40db1f5d28e20b6eda7010e9c530a5d (patch)
tree6f58fe866e43efe6288fd7e448acc956c14c7218 /source4/dns_server
parentfb181752c5a8704140e36977c2723d4d3c4c8166 (diff)
downloadsamba-cebce2b9a40db1f5d28e20b6eda7010e9c530a5d.tar.gz
samba-cebce2b9a40db1f5d28e20b6eda7010e9c530a5d.tar.bz2
samba-cebce2b9a40db1f5d28e20b6eda7010e9c530a5d.zip
s4 dns: More work on updates
Diffstat (limited to 'source4/dns_server')
-rw-r--r--source4/dns_server/dns_server.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/source4/dns_server/dns_server.c b/source4/dns_server/dns_server.c
index fc759a4832..1c45691efc 100644
--- a/source4/dns_server/dns_server.c
+++ b/source4/dns_server/dns_server.c
@@ -286,6 +286,8 @@ static NTSTATUS handle_question(struct dns_server *dns,
continue;
}
+ /* TODO: if the record actually is a DNS_QTYPE_A */
+
ZERO_STRUCT(ans[ai]);
ans[ai].name = talloc_strdup(ans, question->name);
ans[ai].rr_type = DNS_QTYPE_A;
@@ -425,15 +427,37 @@ static NTSTATUS dns_server_process_update(struct dns_server *dns,
struct dns_res_rec **additional, uint16_t *arcount)
{
struct dns_name_question *zone;
+ const struct dns_server_zone *z;
+ size_t host_part_len = 0;
if (in->qdcount != 1) {
- return NT_STATUS_NOT_IMPLEMENTED;
+ return NT_STATUS_INVALID_PARAMETER;
}
zone = in->questions;
+ if (zone->question_type != DNS_QTYPE_SOA) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
DEBUG(0, ("Got a dns update request.\n"));
+ for (z = dns->zones; z != NULL; z = z->next) {
+ bool match;
+
+ match = dns_name_match(z->name, zone->name, &host_part_len);
+ if (match) {
+ break;
+ }
+ }
+
+ if (z == NULL) {
+ return NT_STATUS_FOOBAR;
+ }
+
+ if (host_part_len != 0) {
+ return NT_STATUS_NOT_IMPLEMENTED;
+ }
return NT_STATUS_NOT_IMPLEMENTED;
}