Samba login

Jeremy Allison jeremy at
Tue Nov 7 01:24:02 GMT 2000

Kenichi Okuyama wrote:

> Run readdir() for 'An/' 'An/upperCase/' 'An/upperCase/file/'.
> # Well, it might be better with getdents(2).

This is *exactly* what the statcache does. After this cache
is built, and a pathname comes in then a lookup is done to
match the longest name in the cache, then the stat is done
to ensure the mapping is still valid.

> #What do you do if you have both "An/upperCase/file/paTH" and
> #"aN/UPPERcASE/FILE/PAth"? or "An/upperCase/file/pATH"?
> # What is strategy for this treatment??

You pick the first one that matches, what else can you do ?

> And once you read directory, you can cache it's information.
> So, that second time if Samba was asked for something like
> "AN/UPPERCASE/FILE/NAME", they can search both
> "An/upperCase/file/" and "aN/UPPERcASE/FILE/" without re-reading
> directories.

This is what the statcache *does* :-) :-). The stat is
done at the end of the lookup to determine if the mapping
is still valid.

Am I not being clear enough ? Is the code not clear here ?


Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba-technical mailing list