Samba 3.0.20 - findfirst optimization
Dina Fine
dina at exanet.com
Mon Oct 31 05:09:36 GMT 2005
Yes, this is the reason.
<>*?\" are valid windows wildcards characters, but they are also valid
linux characters.
It means that every mangled name with one of this characters will be
treated as a pattern with wildcards and all matching files will be
returned on Find First request.
Thanks
Dina Fine
Exanet
-----Original Message-----
From: Jeremy Allison [mailto:jra at samba.org]
Sent: Sunday, October 30, 2005 8:22 PM
To: Dina Fine
Cc: Jeremy Allison; g at samba.org; samba-technical at lists.samba.org
Subject: Re: Samba 3.0.20 - findfirst optimization
On Sun, Oct 30, 2005 at 01:41:31PM +0200, Dina Fine wrote:
> Still FindFirst on mangled names doesn't work well both in case
> sensitive = yes and case sensitive = no.
> If the mangled name (as in the example below) is test<>.txt and you
> have also test().txt in the same directory, _unix_convert converts the
> name TKEIRY~Z.TXT to test<>.txt but
> mask_match() (called from get_lanman2_entry) returns true for
> test<>.txt and test().txt (due to <> chars in test<>.txt name)
>
> S:\>dir shlomi\
> > Volume in drive S is c$
> > Volume Serial Number is 2629-002B
> >
> > Directory of S:\shlomi
> >
> > 10/26/2005 09:04 AM <DIR> .
> > 10/26/2005 09:21 AM <DIR> ..
> > 10/26/2005 09:03 AM 5 test().txt
> > 10/26/2005 09:04 AM 5 TKEIRY~Z.TXT
> > 10/26/2005 09:03 AM 6 hello.txt
>
> So when findfirst requests for TKEIRY~Z.TXT, samba returns two files:
> test().txt and test<>.txt which is not good.
> Tcpdump:
> Transaction2 request FIND_FIRST2, Pattern: \TKEIRY~Z.TXT
> Transaction2 response FIND_FIRST2, Files: test().txt TKEIRY~Z.TXT
I'll take a look at this - might be confusing the <> characters in the
name with wildcards (<> are valid windows wildcard characters).
Jeremy.
More information about the samba-technical
mailing list