(This is probably a degradation introduced by the fix to https://bugzilla.samba.org/show_bug.cgi?id=11580) To reproduce on a system that supports volume snapshots: 1. Create a subfolder "d" in a Samba share backed by a volume with snapshots 2. Create a text file "d\f.txt" 3. Create a snapshot 4. Modify d\f.txt content 5. From an 2003R2 client, open the share and right click Properties->Previous versions on d\f.txt - the previous version can be seen and accessed. 6. Right-click Properties->Previous versions on d - the previous directory version is displayed 7. Double click the previous version Expected - previous version opens in a new explorer window Actual - error message (access denied) Also reproducible via smbclient (following meta-script assumes only one snapshot exists): snapshot=`smbclient <credentials> //server/share -c "allinfo d" | grep "^GMT-"` smbclient <credentials> //server/share -c "ls $snapshot\d\*"
Problem does not exist on SMB2 (the root cause is that in SMB1 server, the trans_findfirst handler receives "@GMT-<timestamp>\d\*" as findfirst argument and sends it verbatim to some VFS functions, which don't expect the trailing *. In SMB2 we don't have that - the directory is opened and the handle is queried).
(In reply to Uri Simchoni from comment #0) Of course, to obtain the snapshot in smbclient-based reproduction, the grepping should be for @GMT-, not GMT-.
Why doesn't call_trans2findfirst() strip out the '*' as the trailing mask ? Can you explain further ?
Created attachment 12404 [details] git-am fix for 4.5.x
Created attachment 12405 [details] git-am fix for 4.4.x and 4.3.x
The 4.4.x fix is the same, but the patch set does not include testing using SMB2 because that depends on client fixes which are not being backported to 4.4.x and 4.3.x
The added dependency is just because of the unit tests. The 4.4.x fix does not depend on anything.
Comment on attachment 12404 [details] git-am fix for 4.5.x LGTM.
Comment on attachment 12405 [details] git-am fix for 4.4.x and 4.3.x LGTM. Question - do you also want to back-port the DFS+shapshot server fixes ? I wasn't planning to do that for 4.4.x or below - certainly not the client changes. Let me know.
Re-assigning to Karolin for inclusion in 4.5.x, 4.4.x, 4.3.x.
(In reply to Jeremy Allison from comment #9) The DFS server fixes do not affect this bug, and the client fixes enable testing with SMB2. Since I saw that the client fixes are not being backported further than 4.5.x, I didn't backport the SMB2 testing. It turned out to be pretty clean too, since it amount to just omitting one patch, so I'm all good.
Pushed to autobuild-v4-5-test.
Pushed to v4-5-test.
Patch does not apply on current v4-4-test and v4-3-test: user@host:/data/git/samba/v4-4-test$ git am sc-smb1-ls-44.patch Applying: selftest: add content to files created during shadow_copy2 test Applying: selftest: check file readability in shadow_copy2 test Applying: selftest: test listing directories inside snapshots error: patch failed: selftest/knownfail:325 error: selftest/knownfail: patch does not apply Patch failed at 0003 selftest: test listing directories inside snapshots Re-assigning to Uri.
I've refreshed my v4-4-test and v4-3-test branches from samba.org and it applies cleanly. I'll wait for a day or so to see whether in-flight patches cause the patch to fail.
Created attachment 12467 [details] git-am fix for 4.4.next and 4.3.next This is a patch for 4.4.next - the only difference from failed patch is in the "knownfail". The new patch currently does not apply to v4-3-test, and the old patch still applies to v4-3-test. After the fix for https://bugzilla.samba.org/show_bug.cgi?id=12149 lands in v4-3-test, I'll check which patch is right for 4.3.x.
Assigning to Karolin for inclusion in 4.4. next. As for 4.3.x - I think the bug needs to be fixed because it is a degradation of the 4.3 series and it got fixed in master before the release 4.5.0 (i.e. before 4.3 went security-only). So if we issue a last bugfix release it should be in it. However, we seem to be in some stalemate - the original patch for 4.4 and 4.3 still applies in current public v4-3-test. It probably failed because there are some fixes which for some reason haven't landed in v4-3-test so far. If the fix is applied to v4-4-test, please don't close the bug but reassign to me. I'll sample v4-3-test from time to time and if it changes I'll check whether the original patch finally got broken, which would allow me to issue a corrected patch. Thanks, Uri.
Comment on attachment 12467 [details] git-am fix for 4.4.next and 4.3.next The 4.4 fix is also good for 4.3.
Patch for 4.5 does not apply on current v4-5-test branch: user@host:/data/git/samba/v4-5-test$ git am sc-smb1-ls-45.patch Applying: s2-selftest: run shadow_copy2 test both in NT1 and SMB3 modes error: patch failed: source3/script/tests/test_shadow_copy.sh:5 error: source3/script/tests/test_shadow_copy.sh: patch does not apply error: patch failed: source3/selftest/tests.py:186 error: source3/selftest/tests.py: patch does not apply Patch failed at 0001 s2-selftest: run shadow_copy2 test both in NT1 and SMB3 modes
Pushed to autobuild-v4-{3,4}-test.
(In reply to Karolin Seeger from comment #14) Patch has already been pushed to v4-5-test. Sorry for the noise!