The Samba-Bugzilla – Bug 4614
nocase not working as expected when opening files
Last modified: 2012-05-14 10:33:04 UTC
I am having a problem with the nocase option here: When I do a ls and specify the "wrong" case, all works well. However, when I try to open a file / create a file in a directory / etc, I get a file not found error.
For example, I have mounted a directory using
mount -t cifs -oiocharset=utf8,nocase,user=bla //linux3/vol2 test/
when I do "ls test", I get:
MENU is a directory. When I do ls test/menu (spelling MENU lower case), it works:
bla (being a file)
When I try to cat test/menu/bla, it does not work!! cat test/MENU/bla does work, however.
The same goes for touch test/menu/bla2 - again, MENU works here..
This is a real big problem for me, because for campatibly with Windows, I DO need case insensivity. Using smbfs does not work however due to some strange charset errors.
I am using smbd v 3.0.24 and mount.cifs version: 1.10-3.0.24 (On a debian / lenny system)
I think this is fixed. I tried against Samba Version 3.4.0-GIT-26e114b-devel
and it works with mixed case also.
I am using cifs version 1.60.
1. load cifs module
2. disable unix extensions (echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled)
3. mount a cifs share with nocase option
and then see whether you can access a file in a case insensitive way?
With POSIX semantics, it overrides Case Sensitivity
Created attachment 5338 [details]
patch to indicate server about file names case sensitivity
Include Case Sensitivity flag in smb header's flag field in case of mount
with nocase option.
This patch is necessary but inspite of this patch, Samba server still fails a
NT Create AndX request for a case insensitive file with an error
This is the error I see on Samba server (the file name on server is File2)
[2010/02/12 13:50:49, 5] smbd/open.c:1525(open_file_ntcreate)
open_file_ntcreate: FILE_OPEN requested for file file2 and file doesn't exist.
[2010/02/12 13:50:49, 5] smbd/files.c:407(file_free)
freed files structure 9535 (0 used)
[2010/02/12 13:50:49, 10] smbd/open.c:3131(create_file_unixpath)
Reassigning to Shirish since he's done most of the legwork here. Shirish, should
we convert this to a bug against samba server in light of your last comment? Was there a reason you decided not to send the attached patch upstream?
(In reply to comment #6)
Jeff, let me revisit/reread this bug, I probably would not be able to do
this for a week or so, will update as soon as I can. Thanks.
I am confused. With this Samba server,
case (default) and nocase options seem to be working the same
i.e. with the patch, with nothing specified and with nocase specified,
I am able to create and cat files under <mount_dir>/MENU as well as
I would have expected with a direcotry <share_path>/MENU, with
default option (i.e. no mount option), user would not be able to
create and cat files under <mount_dir>/menu.
I think this bug should be closed. nocase mount option is working as desired
and designed. Please note otherwise.
If not responded, this bug should be closed in a month or so (by (6/15/12).
Closing as FIXED per Shirish's request. Thanks, Shirish!