vfs_fruit: add an option that allows disabling POSIX rename behaviour
authorRalph Boehme <slow@samba.org>
Mon, 11 Apr 2016 10:17:22 +0000 (12:17 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 4 May 2016 22:04:50 +0000 (00:04 +0200)
https://bugzilla.samba.org/show_bug.cgi?id=11721

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May  5 00:04:50 CEST 2016 on sn-devel-144

docs-xml/manpages/vfs_fruit.8.xml
source3/modules/vfs_fruit.c

index 36d137eaea931dbda3b623bdc3435481974367c8..2535f9e5c42430aaca0bdc41643ec2fc935fd9bd 100644 (file)
            </listitem>
          </varlistentry>
 
+         <varlistentry>
+           <term>fruit:posix_rename = yes | no</term>
+           <listitem>
+             <para>Whether to enable POSIX directory rename behaviour
+             for OS X clients. Without this, directories can't be
+             renamed if any client has any file inside it
+             (recursive!) open.</para>
+             <para>The default is <emphasis>yes</emphasis>.</para>
+           </listitem>
+         </varlistentry>
+
        </variablelist>
 </refsect1>
 
index bff9b0b24a78412fd0d5e5e8f207e4ae4351d099..84c40bd21c000e007405fccfce76f96cc7e2ba5c 100644 (file)
@@ -132,6 +132,7 @@ struct fruit_config_data {
        bool unix_info_enabled;
        bool copyfile_enabled;
        bool veto_appledouble;
+       bool posix_rename;
 
        /*
         * Additional options, all enabled by default,
@@ -1355,6 +1356,9 @@ static int init_fruit_config(vfs_handle_struct *handle)
        config->use_copyfile = lp_parm_bool(-1, FRUIT_PARAM_TYPE_NAME,
                                           "copyfile", false);
 
+       config->posix_rename = lp_parm_bool(
+               SNUM(handle->conn), FRUIT_PARAM_TYPE_NAME, "posix_rename", true);
+
        config->readdir_attr_rsize = lp_parm_bool(
                SNUM(handle->conn), "readdir_attr", "aapl_rsize", true);
 
@@ -3451,7 +3455,7 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle,
                        fsp->aapl_copyfile_supported = true;
                }
 
-               if (fsp->is_directory) {
+               if (config->posix_rename && fsp->is_directory) {
                        /*
                         * Enable POSIX directory rename behaviour
                         */