From 4d6a0c0d96af11e41afd2db7990a566942f291ec Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Mon, 11 Apr 2016 12:17:22 +0200 Subject: [PATCH] vfs_fruit: add an option that allows disabling POSIX rename behaviour https://bugzilla.samba.org/show_bug.cgi?id=11721 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Thu May 5 00:04:50 CEST 2016 on sn-devel-144 (cherry picked from commit 625dcef765adc75c34ee5955a08c6cb77b87f41b) --- docs-xml/manpages/vfs_fruit.8.xml | 11 +++++++++++ source3/modules/vfs_fruit.c | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs-xml/manpages/vfs_fruit.8.xml b/docs-xml/manpages/vfs_fruit.8.xml index 2ac5db7..a275344 100644 --- a/docs-xml/manpages/vfs_fruit.8.xml +++ b/docs-xml/manpages/vfs_fruit.8.xml @@ -226,6 +226,17 @@ + + fruit:posix_rename = yes | no + + 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. + The default is yes. + + + diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index cb0d284..89e9412 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -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); @@ -3427,7 +3431,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 */ -- 2.8.0.rc3.226.g39d4020