[PATCH] smbd: Fix snapshot query on shares with DFS enabled

Jeremy Allison jra at samba.org
Tue Aug 16 22:24:48 UTC 2016

On Tue, Aug 16, 2016 at 08:40:15AM -0700, Jeremy Allison wrote:
> On Tue, Aug 16, 2016 at 08:05:55AM +0300, Uri Simchoni wrote:
> > On 08/16/2016 02:44 AM, Jeremy Allison wrote:
> > >>
> > >> I will try to take a closer look tomorrow, maybe that can be easily
> > >> handled in the shadowcopy2 module. The backport should probably wait
> > >> until this is resolved
> > > 
> > > We should probably add a smbclient-based torture test
> > > for both file and directory inside source3/script/tests/test_shadow_copy.sh
> > > once this gets fixed to make sure we don't regress.
> > > 
> > Looking again at the shadow_copy2 test, it's a great step forward vs no
> > test, but it is lacking in some areas.
> > 
> > The current test list previous versions of a file, which queries
> > snapshot file information.
> > a. Not sure it's complete enough - maybe successfully reading the file
> > will be safer
> > b. It does not handle directories at all
> > c. It only runs on SMB1, and with respect to paths, SMB2 may behave
> > differently. Strangely, the test seems to pass on SMB3 (adding -m SMB3),
> > although AFAICT smbclient uses SMB1 calls to list snapshots (so it
> > should have yielded 0 snapshots). I'll have to look into it.
> > 
> > The SMB3 test must, IMHO, access snapshot files using TWrp create
> > context (I don't mind doing it once I have time and it shouldn't stop
> > any bugfixes if it's been reasonably verified that they don't break
> > things, so it's a note to self).
> For the current change, it would be enough to test over SMB2 using
> path with /@GMT-YYYY... appended to the end, as that's exactly
> what the server now does.
> Further tests can add access to the Twrp context, but I don't
> think they're a blocker for adding tests (one for file, one
> for directory) for this specific case.

OK, I now have working SMB2 FSCTL_GET_SHADOW_COPY_DATA client
code, but for SMB2 it seems that Twrp contexts are required
to get at the shadow copies on Windows (I can list 'em, but
doing path/@GMT-YYYY etc. fails with OBJECT_PATH_NOT_FOUND).

Shall I add code into the SMB2 client open that converts
a /@GMT-YYYY... trailing path into a Twrp token ?

What do you think ?


More information about the samba-technical mailing list