vfs_fruit: use check on global_fruit_config.nego_aapl for macOS specific behaviour
authorRalph Boehme <slow@samba.org>
Sat, 20 Oct 2018 13:28:06 +0000 (15:28 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 31 Oct 2018 20:27:20 +0000 (21:27 +0100)
Ensure any non MS compliant protocol behaviour targetted at supporting
macOS clients are only effective if the client negotiated AAPL.

Currently this only guards the resource fork which only macOS client are
going to use, but subsequent commits add more this at this place.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_fruit.c

index 24486f15e9a8854c41a39b5dd3558c3f3f9884b2..52daf9ac489e6457822aba47950e50a6989857d1 100644 (file)
@@ -5892,7 +5892,8 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle,
         *
         * Cf the vfs_fruit torture tests in test_rfork_create().
         */
-       if (is_afpresource_stream(fsp->fsp_name) &&
+       if (global_fruit_config.nego_aapl &&
+           is_afpresource_stream(fsp->fsp_name) &&
            create_disposition == FILE_OPEN)
        {
                if (fsp->fsp_name->st.st_ex_size == 0) {