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

Jeremy Allison jra at samba.org
Wed Aug 17 20:19:11 UTC 2016


On Wed, Aug 17, 2016 at 11:05:23PM +0300, Uri Simchoni wrote:
> > 
> That'll work but, to use your words in this thread, it sucks. If one
> client opens multiple files it shouldn't "change modes" in between.
> Supporting create contexts at some level is better, and it will serve us
> in other areas too, I'm sure.

It's a fair cop 'gov. A modal change does indeed suck :-).

> > As we're designing this change to the API going forward we
> > can mandate this is SMB2+ functionality, and not expose it
> > for SMB1 ?
> > 
> There are two different requirements here:
> 1. invent an API that would allow clients to specify files in snapshots
> - here the @GMT-xxx/path/to/file is the natural one because that's how
> you do it in Windows (there's no timewarp parameter to CreateFile()) and
> it's automatically supported by SMB1. So for SMB2 we'll need to parse
> the path and convert to TWrp create context (yeah I was wrong saying the
> client lib shouldn't mess with it - someone has to :)) - somewhere in
> the transition from protocol-agnostic layer to smb2-specific layer.

Ah ok - that's the missing piece ! I'd prefer the /server/share/path/to/file/@GMT-xxx
approach as that prevents us having to mess understand when we have
a DFS vs. regular path.

I'm assuming the above also works with Windows ? I'm having
trouble on my W2K12R2 box getting @GMT paths to work with SMB1.

They're visible with SMB2, not SMB1. Don't know why yet...

cli_smb2_create_fnum_send() is the perfect place to mess
with the path and create the TWrp blob, as it already strips
/ characters from the start and end of the path.

I'll work on that for the 'allinfo' tests.

> 2. for smbclient utility only, support "chdir'ing" into a snapshot (as
> you can do with Windows explorer) - that can be done using a modal
> variable in smbclient, that prepends the @GMT stuff to the current
> working directory.
> 
> With that it can be supported by both protocols.

Let me think about that for smbclient..



More information about the samba-technical mailing list