summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-03-30 16:54:43 -0700
committerJeremy Allison <jra@samba.org>2010-03-30 16:54:43 -0700
commitf58d02dbeeeba037ee79fba93a707e959e90ffa3 (patch)
treea0058fadb5f0408cb57550309730f86324accd56
parent32c8feab5d8320cba7f47fc27ba0fc264f3c4333 (diff)
downloadsamba-f58d02dbeeeba037ee79fba93a707e959e90ffa3.tar.gz
samba-f58d02dbeeeba037ee79fba93a707e959e90ffa3.tar.bz2
samba-f58d02dbeeeba037ee79fba93a707e959e90ffa3.zip
Second part of fix for bug #6494 - Incorrect FileStatus returned in NT_CREATE_ANDX.
Ensure we do this in nttrans create too. Jeremy.
-rw-r--r--source3/smbd/nttrans.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 93621dde61..b79bb0b8f2 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -1220,7 +1220,25 @@ static void call_nt_transact_create(connection_struct *conn,
SOFF_T(p,0,file_len);
p += 8;
if (flags & EXTENDED_RESPONSE_REQUIRED) {
- SSVAL(p,2,0x7);
+ uint16_t file_status = (NO_EAS|NO_SUBSTREAMS|NO_REPARSETAG);
+ size_t num_names = 0;
+ unsigned int num_streams;
+ struct stream_struct *streams = NULL;
+
+ /* Do we have any EA's ? */
+ status = get_ea_names_from_file(ctx, conn, fsp,
+ smb_fname->base_name, NULL, &num_names);
+ if (NT_STATUS_IS_OK(status) && num_names) {
+ file_status &= ~NO_EAS;
+ }
+ status = SMB_VFS_STREAMINFO(conn, NULL, smb_fname->base_name, ctx,
+ &num_streams, &streams);
+ /* There is always one stream, ::$DATA. */
+ if (NT_STATUS_IS_OK(status) && num_streams > 1) {
+ file_status &= ~NO_SUBSTREAMS;
+ }
+ TALLOC_FREE(streams);
+ SSVAL(p,2,file_status);
}
p += 4;
SCVAL(p,0,fsp->is_directory ? 1 : 0);