summaryrefslogtreecommitdiff
path: root/lib/param
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2011-12-16 14:25:57 +0100
committerKai Blin <kai@samba.org>2011-12-17 04:19:40 +0100
commitb1fdf4065e4569e58ffceb44e9f4105fa1f8740e (patch)
tree22581427e87316d00b3377fed09c6dd296cedaec /lib/param
parentafa98bdc51c635cb7d7cc8c63497598e522610fd (diff)
downloadsamba-b1fdf4065e4569e58ffceb44e9f4105fa1f8740e.tar.gz
samba-b1fdf4065e4569e58ffceb44e9f4105fa1f8740e.tar.bz2
samba-b1fdf4065e4569e58ffceb44e9f4105fa1f8740e.zip
s4 dns: Allow updates based on smb.conf setting
Autobuild-User: Kai Blin <kai@samba.org> Autobuild-Date: Sat Dec 17 04:19:40 CET 2011 on sn-devel-104
Diffstat (limited to 'lib/param')
-rw-r--r--lib/param/loadparm.c12
-rw-r--r--lib/param/param.h1
-rw-r--r--lib/param/param_enums.c8
3 files changed, 21 insertions, 0 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 8ed9ced221..2c59a3ed69 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -65,6 +65,7 @@
#include "s3_param.h"
#include "lib/util/bitmap.h"
#include "libcli/smb/smb_constants.h"
+#include "source4/dns_server/dns_update.h"
#define standard_sub_basic talloc_strdup
@@ -1223,6 +1224,14 @@ static struct parm_struct parm_table[] = {
.special = NULL,
.enum_list = NULL
},
+ {
+ .label = "allow dns updates",
+ .type = P_ENUM,
+ .p_class = P_GLOBAL,
+ .offset = GLOBAL_VAR(allow_dns_updates),
+ .special = NULL,
+ .enum_list = enum_dns_update_settings
+ },
{NULL, P_BOOL, P_NONE, 0, NULL, NULL, 0}
};
@@ -1503,6 +1512,7 @@ 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_INTEGER(server_signing, server_signing)
FN_GLOBAL_INTEGER(client_signing, client_signing)
@@ -3362,6 +3372,8 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
lpcfg_do_global_parameter(lp_ctx, "rndc command", "/usr/sbin/rndc");
lpcfg_do_global_parameter(lp_ctx, "nsupdate command", "/usr/bin/nsupdate -g");
+ lpcfg_do_global_parameter(lp_ctx, "allow dns updates", "False");
+
for (i = 0; parm_table[i].label; i++) {
if (!(lp_ctx->flags[i] & FLAG_CMDLINE)) {
lp_ctx->flags[i] |= FLAG_DEFAULT;
diff --git a/lib/param/param.h b/lib/param/param.h
index f6823859d8..079ef8b9a6 100644
--- a/lib/param/param.h
+++ b/lib/param/param.h
@@ -56,6 +56,7 @@ const char *lpcfg_realm(struct loadparm_context *);
const char *lpcfg_netbios_name(struct loadparm_context *);
const char *lpcfg_private_dir(struct loadparm_context *);
int lpcfg_server_role(struct loadparm_context *);
+int lpcfg_allow_dns_updates(struct loadparm_context *);
void reload_charcnv(struct loadparm_context *lp_ctx);
diff --git a/lib/param/param_enums.c b/lib/param/param_enums.c
index 9307a0c650..d30458fa5d 100644
--- a/lib/param/param_enums.c
+++ b/lib/param/param_enums.c
@@ -107,3 +107,11 @@ static const struct enum_list enum_smb_signing_vals[] = {
{SMB_SIGNING_REQUIRED, "enforced"},
{-1, NULL}
};
+
+/* DNS update options. */
+static const struct enum_list enum_dns_update_settings[] = {
+ {DNS_UPDATE_OFF, "False"},
+ {DNS_UPDATE_ON, "True"},
+ {DNS_UPDATE_SIGNED, "signed"},
+ {-1, NULL}
+};