diff options
author | Kai Blin <kai@samba.org> | 2012-03-27 14:42:15 +0200 |
---|---|---|
committer | Kai Blin <kai@samba.org> | 2012-03-27 16:03:16 +0200 |
commit | 06dd4d8ee1c5440809fa87fd8a1f3cfac8e9036a (patch) | |
tree | 69e5a3654d52423e92dc256dad9d2815ab6c1cd7 | |
parent | 533b2e6612bd6497c1d53c31912bccba0260a3e9 (diff) | |
download | samba-06dd4d8ee1c5440809fa87fd8a1f3cfac8e9036a.tar.gz samba-06dd4d8ee1c5440809fa87fd8a1f3cfac8e9036a.tar.bz2 samba-06dd4d8ee1c5440809fa87fd8a1f3cfac8e9036a.zip |
s4 dns: Check smb.conf if we should allow recursion
-rw-r--r-- | lib/param/loadparm.c | 21 | ||||
-rw-r--r-- | source4/dns_server/dns_server.c | 5 |
2 files changed, 24 insertions, 2 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index bb59a79d0c..e3792b6195 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -1256,6 +1256,22 @@ static struct parm_struct parm_table[] = { .special = NULL, .enum_list = enum_dns_update_settings }, + { + .label = "dns forwarder", + .type = P_STRING, + .p_class = P_GLOBAL, + .offset = GLOBAL_VAR(dns_forwarder), + .special = NULL, + .enum_list = NULL + }, + { + .label = "dns recursive queries", + .type = P_BOOL, + .p_class = P_GLOBAL, + .offset = GLOBAL_VAR(dns_recursive_queries), + .special = NULL, + .enum_list = NULL + }, {NULL, P_BOOL, P_NONE, 0, NULL, NULL, 0} }; @@ -1536,7 +1552,10 @@ FN_GLOBAL_INTEGER(srv_minprotocol, srv_minprotocol) FN_GLOBAL_INTEGER(cli_maxprotocol, cli_maxprotocol) FN_GLOBAL_INTEGER(cli_minprotocol, cli_minprotocol) FN_GLOBAL_BOOL(paranoid_server_security, paranoid_server_security) + FN_GLOBAL_INTEGER(allow_dns_updates, allow_dns_updates) +FN_GLOBAL_CONST_STRING(dns_forwarder, dns_forwarder) +FN_GLOBAL_BOOL(dns_recursive_queries, dns_recursive_queries) FN_GLOBAL_INTEGER(server_signing, server_signing) FN_GLOBAL_INTEGER(client_signing, client_signing) @@ -3403,6 +3422,8 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx) lpcfg_do_global_parameter(lp_ctx, "nsupdate command", "/usr/bin/nsupdate -g"); lpcfg_do_global_parameter(lp_ctx, "allow dns updates", "False"); + lpcfg_do_global_parameter(lp_ctx, "dns recursive queries", "False"); + lpcfg_do_global_parameter(lp_ctx, "dns forwarder", ""); for (i = 0; parm_table[i].label; i++) { if (!(lp_ctx->flags[i] & FLAG_CMDLINE)) { diff --git a/source4/dns_server/dns_server.c b/source4/dns_server/dns_server.c index 9e88bd9ebf..789940ff94 100644 --- a/source4/dns_server/dns_server.c +++ b/source4/dns_server/dns_server.c @@ -139,8 +139,9 @@ static NTSTATUS dns_process(struct dns_server *dns, *out_packet = *in_packet; state->flags |= in_packet->operation | DNS_FLAG_REPLY; - /* TODO: Allow setting the forwarding in smb.conf or the like */ - state->flags |= DNS_FLAG_RECURSION_AVAIL; + if (lpcfg_dns_recursive_queries(dns->task->lp_ctx)) { + state->flags |= DNS_FLAG_RECURSION_AVAIL; + } switch (in_packet->operation & DNS_OPCODE) { case DNS_OPCODE_QUERY: |