[PATCHES] vfs_shadow_copy2: more tests and fix of a bug with SMB1

Jeremy Allison jra at samba.org
Wed Aug 24 19:29:53 UTC 2016


On Wed, Aug 24, 2016 at 09:08:48PM +0300, Uri Simchoni wrote:
> Hi,
> 
> The attached patch set (some of which I already sent yesterday) adds
> some more tests to shadow_copy2 module and then fixes a bug that was
> discovered by one of those tests, namely that snapshot folders cannot be
> listed using SMB1.
> 
> The fix may be controversial. The cause of the bug is that when listing
> files with SMB1, call_trans2findfirst() is given a path of
> path\to\dir\*, as this is what goes over the wire, and the
> call_trans2findfirst() passes this path (after minimum SMB->unix
> conversion) to some VFS functions (lstat, connectpath, realpath - via
> check_reduced_name()). With the trailing "*". The connectpath VFS
> function of shadow_copy2 overrides default behavior and fails with this
> trailing "*".
> 
> The obvious fix seems to be to strip the "*" before going to the VFS,
> because the VFS layer doesn't expect those things.

Actually that's not true. call_trans2findfirst() passes the given
name ultimately to filename_convert_internal() which takes the
flags:

UCF_COND_ALLOW_WCARD_LCOMP
UCF_ALWAYS_ALLOW_WCARD_LCOMP

which explicitly allow a wildcard as the last component.

The default vfs copes with these things fine, so I'm
guessing this is something broken in shadow_copy2, which
is where you're doing the fix. So I'd argue you're fixing
the right place.

Haven't reviewed your code yet, but just wanted to correct
the misapprehension above.



More information about the samba-technical mailing list