vfs_fruit: enabling AAPL extensions must be a global switch
authorRalph Boehme <slow@samba.org>
Tue, 28 Feb 2017 08:39:37 +0000 (09:39 +0100)
committerUri Simchoni <uri@samba.org>
Thu, 2 Mar 2017 03:34:10 +0000 (04:34 +0100)
Apple's SMB2 AAPL extension is enabled once per SMB2
connection. Unfortunately the (per se correct) fix for bug #12541
results in vfs_fruit checking a per tcon config state variable to
determine whether AAPL has been negotiated. This variable will be false
for all but the first tcon. We must make it a global variable.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12604

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Thu Mar  2 04:34:10 CET 2017 on sn-devel-144

source3/modules/vfs_fruit.c

index edac0cf49348f8b1a7d759442c9fa1678e918051..fc806297d9619186512188111024d4f7712e796b 100644 (file)
 
 static int vfs_fruit_debug_level = DBGC_VFS;
 
+static struct global_fruit_config {
+       bool nego_aapl; /* client negotiated AAPL */
+
+} global_fruit_config;
+
 #undef DBGC_CLASS
 #define DBGC_CLASS vfs_fruit_debug_level
 
@@ -124,7 +129,6 @@ struct fruit_config_data {
        enum fruit_locking locking;
        enum fruit_encoding encoding;
        bool use_aapl;          /* config from smb.conf */
-       bool nego_aapl;         /* client negotiated AAPL */
        bool use_copyfile;
        bool readdir_attr_enabled;
        bool unix_info_enabled;
@@ -2231,7 +2235,7 @@ static NTSTATUS check_aapl(vfs_handle_struct *handle,
                                      SMB2_CREATE_TAG_AAPL,
                                      blob);
        if (NT_STATUS_IS_OK(status)) {
-               config->nego_aapl = true;
+               global_fruit_config.nego_aapl = true;
        }
 
        return status;
@@ -4933,7 +4937,7 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle,
 
        fsp = *result;
 
-       if (config->nego_aapl) {
+       if (global_fruit_config.nego_aapl) {
                if (config->copyfile_enabled) {
                        /*
                         * Set a flag in the fsp. Gets used in
@@ -5010,7 +5014,7 @@ static NTSTATUS fruit_readdir_attr(struct vfs_handle_struct *handle,
                                struct fruit_config_data,
                                return NT_STATUS_UNSUCCESSFUL);
 
-       if (!config->nego_aapl) {
+       if (!global_fruit_config.nego_aapl) {
                return SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data);
        }