s3:param: Add new option "strict rename".
authorJeremy Allison <jra@samba.org>
Fri, 24 Oct 2014 20:57:04 +0000 (13:57 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 31 Oct 2014 02:47:40 +0000 (03:47 +0100)
Control whether smbd can rename directories containing
open files. Defaults to "no" (meaning we *can* do
such renames).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
docs-xml/smbdotconf/tuning/strictrename.xml [new file with mode: 0644]
lib/param/param_table.c
source3/param/loadparm.c

diff --git a/docs-xml/smbdotconf/tuning/strictrename.xml b/docs-xml/smbdotconf/tuning/strictrename.xml
new file mode 100644 (file)
index 0000000..5478863
--- /dev/null
@@ -0,0 +1,25 @@
+<samba:parameter name="strict rename"
+                 context="S"
+                                type="boolean"
+                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+    <para>By default a Windows SMB server prevents directory
+    renames when there are open file or directory handles below
+    it in the filesystem hierarchy. Historically Samba has always
+    allowed this as POSIX filesystem semantics require it.</para>
+
+    <para>This boolean parameter allows Samba to match the Windows
+    behavior. Setting this to "yes" is a very expensive change,
+    as it forces Samba to travers the entire open file handle
+    database on every directory rename request. In a clustered
+    Samba system the cost is even greater than the non-clustered
+    case.</para>
+
+    <para>For this reason the default is "no", and it is recommended
+    to be left that way unless a specific Windows application requires
+    it to be changed.</para>
+
+</description>
+
+<value type="default">no</value>
+</samba:parameter>
index 15ffa8c3f69b679fa5b31a8cbbd4bae3baf33a90..7a13e6f84a677b4a6c463e09080d8973e5db8af4 100644 (file)
@@ -1883,6 +1883,15 @@ struct parm_struct parm_table[] = {
                .enum_list      = NULL,
                .flags          = FLAG_ADVANCED | FLAG_SHARE,
        },
+       {
+               .label          = "strict rename",
+               .type           = P_BOOL,
+               .p_class        = P_LOCAL,
+               .offset         = LOCAL_VAR(strict_rename),
+               .special        = NULL,
+               .enum_list      = NULL,
+               .flags          = FLAG_ADVANCED | FLAG_SHARE,
+       },
        {
                .label          = "strict sync",
                .type           = P_BOOL,
index f68c001f46eb3144db1e961146d4a7c71362c561..d6ba8fba1028957da7521ab47944b2d63c5399ab 100644 (file)
@@ -206,6 +206,7 @@ static struct loadparm_service sDefault =
        .follow_symlinks = true,
        .sync_always = false,
        .strict_allocate = false,
+       .strict_rename = false,
        .strict_sync = false,
        .mangling_char = '~',
        .copymap = NULL,