summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2015-11-25 09:12:55 +0100
committerKarolin Seeger <kseeger@samba.org>2015-12-18 10:26:22 +0100
commit3a1a67eef4202d64af8be9f0d297f0aeb3f3e6bf (patch)
tree78ad2fcb2713d44af2e9bf66a11437cffd847551
parentb5a081bb5ef414c94fc67e03cf74e27146605eae (diff)
downloadsamba-3a1a67eef4202d64af8be9f0d297f0aeb3f3e6bf.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> (cherry picked from commit 89a7394d679b383920d73fef0d178b8f84bc393f)
-rw-r--r--source3/modules/vfs_fruit.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 461311cbc61..02906c621d8 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -123,7 +123,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;
@@ -1901,6 +1902,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;
}
@@ -3345,16 +3349,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;
+ }
}
/*