summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2013-02-20 14:59:42 +1030
committerRusty Russell <rusty@rustcorp.com.au>2013-02-20 05:31:20 +0100
commit3c9c3029f2bcf10ef614dd9f923d02232db3ac8d (patch)
tree4302afa36dee7fc05863a0e467c468f2b7824bb6
parente201033e84b54b13acc751db2b67cff159e12a0e (diff)
downloadsamba-3c9c3029f2bcf10ef614dd9f923d02232db3ac8d.tar.gz
samba-3c9c3029f2bcf10ef614dd9f923d02232db3ac8d.tar.bz2
samba-3c9c3029f2bcf10ef614dd9f923d02232db3ac8d.zip
param: 'use ntdb' flag (off by default).
For simplicity, we use this in the caller to choose between filenames. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--docs-xml/smbdotconf/tuning/usentdb.xml23
-rw-r--r--lib/param/param_functions.c1
-rw-r--r--lib/param/param_table.c9
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/param/loadparm_ctx.c1
5 files changed, 35 insertions, 0 deletions
diff --git a/docs-xml/smbdotconf/tuning/usentdb.xml b/docs-xml/smbdotconf/tuning/usentdb.xml
new file mode 100644
index 0000000000..9a0d2cde79
--- /dev/null
+++ b/docs-xml/smbdotconf/tuning/usentdb.xml
@@ -0,0 +1,23 @@
+<samba:parameter name="use ntdb"
+ context="G"
+ type="boolean"
+ xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+ <para>Beginning in Samba 4.1, a growing number of databases can
+ use the NTDB format rather than TDB.
+ </para>
+ <para>If you enable this option these databases will defaul to a
+ <filename>.ntdb</filename> extension rather than
+ <filename>.tdb</filename>: If the <filename>.tdb</filename> file
+ exists, it will automatically be converted to NTDB and renamed to
+ <filename>.tdb.bak</filename>.
+ </para>
+ <para>Filenames explicitly specified in
+ <filename>smb.conf</filename> will be respected (ie. the format
+ will depend on the <filename>.ntdb</filename> or
+ <filename>.tdb</filename> extension).
+ </para>
+</description>
+
+<value type="default">no</value>
+</samba:parameter>
diff --git a/lib/param/param_functions.c b/lib/param/param_functions.c
index 852f525c44..4cf3ad7698 100644
--- a/lib/param/param_functions.c
+++ b/lib/param/param_functions.c
@@ -215,6 +215,7 @@ FN_GLOBAL_BOOL(unicode, bUnicode)
FN_GLOBAL_BOOL(unix_extensions, bUnixExtensions)
FN_GLOBAL_BOOL(unix_password_sync, bUnixPasswdSync)
FN_GLOBAL_BOOL(use_mmap, bUseMmap)
+FN_GLOBAL_BOOL(use_ntdb, bUseNtdb)
FN_GLOBAL_BOOL(usershare_allow_guests, bUsershareAllowGuests)
FN_GLOBAL_BOOL(usershare_owner_only, bUsershareOwnerOnly)
FN_GLOBAL_BOOL(use_spnego, bUseSpnego)
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index a73cd966bc..620f5f679b 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -1895,6 +1895,15 @@ static struct parm_struct parm_table[] = {
.flags = FLAG_ADVANCED,
},
{
+ .label = "use ntdb",
+ .type = P_BOOL,
+ .p_class = P_GLOBAL,
+ .offset = GLOBAL_VAR(bUseNtdb),
+ .special = NULL,
+ .enum_list = NULL,
+ .flags = FLAG_ADVANCED,
+ },
+ {
.label = "use sendfile",
.type = P_BOOL,
.p_class = P_LOCAL,
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 77b949037b..c36125e53e 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1161,6 +1161,7 @@ bool lp_client_ntlmv2_auth(void);
bool lp_host_msdfs(void);
bool lp_enhanced_browsing(void);
bool lp_use_mmap(void);
+bool lp_use_ntdb(void);
bool lp_unix_extensions(void);
bool lp_unicode(void);
bool lp_use_spnego(void);
diff --git a/source3/param/loadparm_ctx.c b/source3/param/loadparm_ctx.c
index 75f7e38957..63ead53ac1 100644
--- a/source3/param/loadparm_ctx.c
+++ b/source3/param/loadparm_ctx.c
@@ -112,6 +112,7 @@ static const struct loadparm_s3_helpers s3_fns =
.unix_extensions = lp_unix_extensions,
.use_spnego = lp_use_spnego,
.use_mmap = lp_use_mmap,
+ .use_ntdb = lp_use_ntdb,
.srv_minprotocol = lp_srv_minprotocol,
.srv_maxprotocol = lp_srv_maxprotocol,