vfs_fruit: enable zero file id
authorUri Simchoni <uri@samba.org>
Thu, 23 Mar 2017 12:08:45 +0000 (14:08 +0200)
committerRalph Boehme <slow@samba.org>
Sun, 26 Mar 2017 17:42:16 +0000 (19:42 +0200)
Enable zero_file_id if both conditions are met:
- AAPL negotiated
- fruit:zero_file_id is set

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12715

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_fruit.c

index fc806297d9619186512188111024d4f7712e796b..0b5558a4487486a35475ba47b35b431de69a3315 100644 (file)
@@ -135,6 +135,7 @@ struct fruit_config_data {
        bool copyfile_enabled;
        bool veto_appledouble;
        bool posix_rename;
+       bool aapl_zero_file_id;
 
        /*
         * Additional options, all enabled by default,
@@ -1591,6 +1592,9 @@ static int init_fruit_config(vfs_handle_struct *handle)
        config->posix_rename = lp_parm_bool(
                SNUM(handle->conn), FRUIT_PARAM_TYPE_NAME, "posix_rename", true);
 
+       config->aapl_zero_file_id =
+           lp_parm_bool(-1, FRUIT_PARAM_TYPE_NAME, "zero_file_id", true);
+
        config->readdir_attr_rsize = lp_parm_bool(
                SNUM(handle->conn), "readdir_attr", "aapl_rsize", true);
 
@@ -2236,6 +2240,9 @@ static NTSTATUS check_aapl(vfs_handle_struct *handle,
                                      blob);
        if (NT_STATUS_IS_OK(status)) {
                global_fruit_config.nego_aapl = true;
+               if (config->aapl_zero_file_id) {
+                       aapl_force_zero_file_id(handle->conn->sconn);
+               }
        }
 
        return status;