summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-08-19 21:58:56 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-08-20 21:57:46 +1000
commit6ce084f092fc1b991e5c7bc3f56fd98a4293caae (patch)
tree17812b26c74091f30cc5b888c393db9e77fd8ee3 /source3/smbd
parentf9f8a8c3d8bf1b027f149d2753824d9b2867f2ca (diff)
downloadsamba-6ce084f092fc1b991e5c7bc3f56fd98a4293caae.tar.gz
samba-6ce084f092fc1b991e5c7bc3f56fd98a4293caae.tar.bz2
samba-6ce084f092fc1b991e5c7bc3f56fd98a4293caae.zip
s3-smbd: Do not look for EA information on a stream
The estimated EA size needs to be of the main file. However, the fsp may point to the stream, so we need to ignore it if this is the case. This may mean we estimate wrong if there has been a rename. Andrew Bartlett
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/trans2.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 152ef73c9b..0be45d01f9 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -501,12 +501,14 @@ static unsigned int estimate_ea_size(connection_struct *conn, files_struct *fsp,
return 0;
}
mem_ctx = talloc_stackframe();
- status = get_full_smb_filename(mem_ctx, smb_fname, &fname);
- if (!NT_STATUS_IS_OK(status)) {
- TALLOC_FREE(mem_ctx);
- return 0;
+
+ /* If this is a stream fsp, then we need to instead find the
+ * estimated ea len from the main file, not the stream
+ * (streams cannot have EAs) */
+ if (is_ntfs_stream_smb_fname(smb_fname)) {
+ fsp = NULL;
}
- (void)get_ea_list_from_file(mem_ctx, conn, fsp, fname, &total_ea_len);
+ (void)get_ea_list_from_file(mem_ctx, conn, fsp, smb_fname->base_name, &total_ea_len);
TALLOC_FREE(mem_ctx);
return total_ea_len;
}
@@ -4650,7 +4652,7 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
{
int len;
unsigned int ea_size =
- estimate_ea_size(conn, fsp, smb_fname->base_name);
+ estimate_ea_size(conn, fsp, smb_fname);
DEBUG(10,("smbd_do_qfilepathinfo: SMB2_FILE_ALL_INFORMATION\n"));
put_long_date_timespec(conn->ts_res,pdata+0x00,create_time_ts);
put_long_date_timespec(conn->ts_res,pdata+0x08,atime_ts);