summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-03-26 15:54:31 -0700
committerDavid Disseldorp <ddiss@samba.org>2013-04-02 20:06:38 +0200
commit15fa043b7d362ee197835c0a72a936684c774472 (patch)
tree070086ab82b6dfc14aa6ed962c09418a198dc79e
parentd9e7c8219fd8b3d770301a87bc1cd62b07b989ca (diff)
downloadsamba-15fa043b7d362ee197835c0a72a936684c774472.tar.gz
samba-15fa043b7d362ee197835c0a72a936684c774472.tar.bz2
samba-15fa043b7d362ee197835c0a72a936684c774472.zip
Change estimate_ea_size() to correctly estimate the EA size over SMB2.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@suse.de>
-rw-r--r--source3/smbd/trans2.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 61252ba507..83988583b7 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -535,6 +535,26 @@ static unsigned int estimate_ea_size(connection_struct *conn, files_struct *fsp,
fsp = NULL;
}
(void)get_ea_list_from_file_path(mem_ctx, conn, fsp, smb_fname->base_name, &total_ea_len, &ea_list);
+ if(conn->sconn->using_smb2) {
+ NTSTATUS status;
+ unsigned int ret_data_size;
+ /*
+ * We're going to be using fill_ea_chained_buffer() to
+ * marshall EA's - this size is significantly larger
+ * than the SMB1 buffer. Re-calculate the size without
+ * marshalling.
+ */
+ status = fill_ea_chained_buffer(mem_ctx,
+ NULL,
+ 0,
+ &ret_data_size,
+ conn,
+ ea_list);
+ if (!NT_STATUS_IS_OK(status)) {
+ ret_data_size = 0;
+ }
+ total_ea_len = ret_data_size;
+ }
TALLOC_FREE(mem_ctx);
return total_ea_len;
}