diff options
author | Ralph Boehme <slow@samba.org> | 2015-11-25 09:12:55 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2015-12-01 20:45:20 +0100 |
commit | 89a7394d679b383920d73fef0d178b8f84bc393f (patch) | |
tree | cb7c53503dd251de8d842bdef702d37bb96a902e /source3/modules/vfs_fruit.c | |
parent | bf1957584e341473edcd5025b7f77766440d408b (diff) | |
download | samba-89a7394d679b383920d73fef0d178b8f84bc393f.tar.gz |
vfs_fruit: add a flag that tracks whether use of AAPL was negotiated
Add a flag that tracks whether use of AAPL was negotiated, ensuring we
don't enable AAPL features for clients that didn't negotiate it.
Torture test that need AAPL must call the new function enable_aapl().
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11065
Signed-off-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/modules/vfs_fruit.c')
-rw-r--r-- | source3/modules/vfs_fruit.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index bd71ff1ec54..79c6651dbb6 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -125,7 +125,8 @@ struct fruit_config_data { enum fruit_meta meta; enum fruit_locking locking; enum fruit_encoding encoding; - bool use_aapl; + bool use_aapl; /* config from smb.conf */ + bool nego_aapl; /* client negotiated AAPL */ bool use_copyfile; bool readdir_attr_enabled; bool unix_info_enabled; @@ -1926,6 +1927,9 @@ static NTSTATUS check_aapl(vfs_handle_struct *handle, out_context_blobs, SMB2_CREATE_TAG_AAPL, blob); + if (NT_STATUS_IS_OK(status)) { + config->nego_aapl = true; + } return status; } @@ -3386,16 +3390,20 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle, if (!NT_STATUS_IS_OK(status)) { return status; } + fsp = *result; - if (config->copyfile_enabled) { - /* - * Set a flag in the fsp. Gets used in copychunk to - * check whether the special Apple copyfile semantics - * for copychunk should be allowed in a copychunk - * request with a count of 0. - */ - fsp->aapl_copyfile_supported = true; + if (config->nego_aapl) { + if (config->copyfile_enabled) { + /* + * Set a flag in the fsp. Gets used in + * copychunk to check whether the special + * Apple copyfile semantics for copychunk + * should be allowed in a copychunk request + * with a count of 0. + */ + fsp->aapl_copyfile_supported = true; + } } /* |