|
|
|
|
|
by jra_samba
2125 days ago
|
|
You are incorrect. It is the only way for a user-space application to provide Windows-style case insensitivity. Windows slient sends a name "foo" over SMB2+. Samba does a stat("foo", &st) call, gets ENOENT. Now, does that name really not exist ? Or is it there in the requested directory under any of the names "FOO"/"FOo"/"Foo"/"fOo"/"fOO"/"FoO" etc. ? The only way for an application to tell is to do: opendir()
fname = readdir()....
check strlower(client_provided_name, fname);
closedir(). If the file really doesn't exist you have ended up scanning the whole directory. Because Linux doesn't provide directory leasing you have to do this for every missed lookup (another process might have created it in the meantime). There is no POSIX API for "does this file exist under another cased name" ? If there were Samba would use it. |
|
I now understand you mean that the directory is in fact scanned (and filenames compared in a case insensitive manner) once a miss occurs. Which is what I was hinting at.
Apologies, I misunderstood your post — and my reply could have been clearer also.