s3: Fix trans2 path to use case-insensitive stat optimization
commitd1f5a693cf6b1b27d815ef16ac0b490a4b121449
authortprouty <tprouty@b72e2a10-2d34-0410-9a71-d3beadf02b57>
Sat, 2 May 2009 00:28:38 +0000 (2 00:28 +0000)
committerKarolin Seeger <kseeger@samba.org>
Tue, 26 May 2009 07:38:50 +0000 (26 09:38 +0200)
tree759072df91ccae5d0d2a4002149a9c9224972a79
parent85c7ec9d9a0fa44788c673c676ce3c305c096f6b
s3: Fix trans2 path to use case-insensitive stat optimization

Often times before creating a file, a client will first query to see
if it already exists.  Since some systems have a case-insensitive stat
that is called from unix_convert, we can definitively return
STATUS_NO_SUCH_FILE to the client without scanning the whole
directory.

This code path is taken from trans2querypathinfo, but trans2findfirst
still does a full directory scan even though the get_real_filename
(the case-insensitive stat vfs call) can prevent this.

This patch adds the get_real_filename call to the trans2find* path,
and also changes the vfs_default behavior for
SMB_VFS_GET_REAL_FILENAME.  Previously, in the absence of a
get_real_filename implementation, we would fallback to the full
directory scan.  The default behavior now returns -1 and sets errno to
EOPNOTSUPP.  This allows SMB_VFS_GET_REALFILENAME to be called from
trans2* and unix_convert.
(cherry picked from commit 92558a875ebf842e652614a5519ae101dd62ffd1)
source3/modules/vfs_default.c
source3/smbd/dir.c
source3/smbd/filename.c