Bug 11104 - SMB2/SMB3 close response does not include attributes when requested
SMB2/SMB3 close response does not include attributes when requested
Status: RESOLVED FIXED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services
4.2.0rc4
All All
: P5 major
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-02-19 07:03 UTC by Steve French
Modified: 2015-02-22 19:35 UTC (History)
2 users (show)

See Also:


Attachments
success trace to Windows 7 (as server) (6.36 KB, application/octet-stream)
2015-02-19 07:03 UTC, Steve French
no flags Details
Failure trace to Samba 4.2-rc4 (5.25 KB, application/octet-stream)
2015-02-19 07:04 UTC, Steve French
no flags Details
git-am fix for master and 4.2.0 (967 bytes, patch)
2015-02-19 17:41 UTC, Jeremy Allison
no flags Details
Raw patch for 4.2.0/master (3.69 KB, patch)
2015-02-20 01:12 UTC, Jeremy Allison
no flags Details
git-am fix for master. (5.78 KB, patch)
2015-02-20 02:56 UTC, Jeremy Allison
sfrench: review+
Details
git-am fix for 4.2.0 (6.24 KB, patch)
2015-02-20 20:05 UTC, Jeremy Allison
sfrench: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve French 2015-02-19 07:03:50 UTC
Created attachment 10747 [details]
success trace to Windows 7 (as server)

See MS-SMB2 section 3.3.5.10 and compare with Frames 23/24 (failure to Samba 4.2rc4) and Frames 21/22 of the working trace (to Windows 7)

 If SMB2_CLOSE_FLAG_POSTQUERY_ATTRIB was set:
 CreationTime, LastAccessTime, LastWriteTime, ChangeTime, AllocationSize,
EndofFile, and FileAttributes MUST be set to the values returned from the attribute query

Found with the Microsoft Functional Test suite - createclose test s604
Comment 1 Steve French 2015-02-19 07:04:25 UTC
Created attachment 10748 [details]
Failure trace to Samba 4.2-rc4
Comment 2 Jeremy Allison 2015-02-19 17:41:54 UTC
Created attachment 10753 [details]
git-am fix for master and 4.2.0

Simple fix - looks like we were just reading the flags field from the wrong place in the packet.

Can you test this please Steve ?

Jermey.
Comment 3 Jeremy Allison 2015-02-19 23:24:53 UTC
Comment on attachment 10753 [details]
git-am fix for master and 4.2.0

No, this patch is wrong :-(. We are reading the correct field. Need to understand why this is not getting the flags field correctly...
Comment 4 Jeremy Allison 2015-02-19 23:42:50 UTC
AHA ! *NOW* I understand....

This is a delete on close test.

However, we do a stat/lstat call in the close handling *after* we've deleted the file, so can't get the data. We need to return the values from the stat from before the file gets deleted...
Comment 5 Jeremy Allison 2015-02-20 01:12:54 UTC
Created attachment 10757 [details]
Raw patch for 4.2.0/master

Steve, please check this works. If so I'll turn it into a proper git-am patchset.
Comment 6 Steve French 2015-02-20 02:30:49 UTC
Yes - JRA's patch fixed the bug
Comment 7 Jeremy Allison 2015-02-20 02:56:44 UTC
Created attachment 10758 [details]
git-am fix for master.

Patch I've sent to samba-technical. Please add 'Reviewed-by' on the list then I'll upload the cherry-pick for inclusion.
Comment 8 Jeremy Allison 2015-02-20 20:05:00 UTC
Created attachment 10761 [details]
git-am fix for 4.2.0

Cherry picked from the code that went into master. Steve please +1 for 4.2.0.
Comment 9 Jeremy Allison 2015-02-20 22:46:38 UTC
Re-assigning to Karolin for inclusion in 4.2.0.

Steve, let me know if you want this in 4.1.x, 4.0.x - I'm not currently planning to back-port.
Comment 10 Steve French 2015-02-20 22:56:26 UTC
Given that it does not appear to have any security implications and the relatively small differences between 4.2 and 4.1, just putting in 4.2 and mater is fine.
Comment 11 Karolin Seeger 2015-02-22 13:18:51 UTC
Pushed to autobuild-v4-2-test.
Comment 12 Karolin Seeger 2015-02-22 19:35:40 UTC
Pushed to v4-2-test.
Closing out bug report.

Thanks!