Make us pass RAW-CHKPATH with a case sensitive share.
authorJeremy Allison <jra@samba.org>
Wed, 25 Nov 2009 21:17:56 +0000 (13:17 -0800)
committerJeremy Allison <jra@samba.org>
Wed, 25 Nov 2009 21:17:56 +0000 (13:17 -0800)
commitc96d487ae3c65c17b377bb316adac4b5775448f3
treedf74fe3a61a24df2226fe65b797621ba642c1f84
parent108da2adaf77c152fd292bbdf5645923659a7c2c
Make us pass RAW-CHKPATH with a case sensitive share.
I know Volker will look at this closely so here's the explaination :-).
Originally on a case-sensitive share we simply did a stat (or lstat)
call and returned success of fail based on the result. However this
failed to take account of incoming paths with a wildcard (which must
always fail, and with different error messages depending on whether
the wildcard is the last component or in the path). Also it failed
to take account of a stat fail with ENOENT due to a missing component
of the path as the last component (which is ok as it could be a new
file)  or if the ENOENT was due to the missing component within
the path (not the last component) - which must return the correct
error. What this means is that with "case sensitive = yes" we do
one more talloc call (to get the parent directory) and one more
stat call (on the parent directory) in the case where the stat
call fails. I think this is an acceptable overhead to enable
case sensitive shares to return the correct error messages for
applications. Volker please examine carefully :-).
Jeremy.
source3/smbd/filename.c