Bug 7051 - cifs file system case sensitive
Summary: cifs file system case sensitive
Status: NEW
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: kernel fs (show other bugs)
Version: 2.6
Hardware: x86 Linux
: P3 major
Target Milestone: ---
Assignee: Steve French
QA Contact: cifs QA contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-20 10:33 UTC by Flor
Modified: 2020-07-16 00:12 UTC (History)
3 users (show)

See Also:


Attachments
patch to indicase server about file names case sensitivity (807 bytes, patch)
2010-02-12 12:22 UTC, shirishpargaonkar@gmail.com
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Flor 2010-01-20 10:33:23 UTC
We have a server which hostname is powernas with samba 3.0.9 that exports file system to web server client linux (portal5) release 2.6.18-128.el5PAE #1 SMP Wed Dec 17 12:02:33 EST 2008 i686 i686 i386 GNU/Linux

[oraias@portal5 cifs]$ smbclient -L \\powernas
Password:
Domain=[PRPM] OS=[Unix] Server=[Samba 3.0.9-1.3E.16]

        Sharename       Type      Comment
        ---------       ----      -------
        aplicacion      Disk      aplicacion para IAS

But when we access via this URL :
http://forms.prpmalaga.es/forms/frmservlet?config=PRP&form=PRPCONEXION.fmx
it is case sensitive.It is mounted as cifs file system:
//192.168.0.50/aplicacion /home/oracle/aplicacion/ cifs username=userias,password=clave_ias,uid=502,gid=500,rw 0 0

In others web servers it isn't case sensitive (it is mounted as smbfs file system)and the same URL works ok:
//192.168.0.50/aplicacion /home/oracle/aplicacion/ smbfs username=userias,password=clave_ias 0 0
Comment 1 shirishpargaonkar@gmail.com 2010-01-21 13:18:17 UTC
Can you try cifs mount with option nocase?
Comment 2 shirishpargaonkar@gmail.com 2010-01-22 06:14:17 UTC
Can you list (ls or ls -l) files under /home/oracle/aplicacion/ ?
Or can you cat (cat /home/oracle/aplicacion/) one of the mixed case files

without going via URL?

What is the version of cifs client that you are using (modinfo cifs)
Comment 3 shirishpargaonkar@gmail.com 2010-01-22 09:36:50 UTC
There is a difference in the way cifs and smbfs are used.
Can you use mount a share using cifs without specifying uid and gid 
because it looks like a share is mounted using smbfs without uid and gid.

Is the file PRPCONEXION.fmx under /home/oracle/aplicacion/ ?

You may want to generate a wireshark trace when you try to access the url
and attach it here, that would help to see what fails.
Comment 4 Flor 2010-01-25 03:45:56 UTC
(In reply to comment #3)
> There is a difference in the way cifs and smbfs are used.
> Can you use mount a share using cifs without specifying uid and gid 
> because it looks like a share is mounted using smbfs without uid and gid.
> Is the file PRPCONEXION.fmx under /home/oracle/aplicacion/ ?
> You may want to generate a wireshark trace when you try to access the url
> and attach it here, that would help to see what fails.

I don't understand what do you mean about gid and uid, because these are the user and group of the files.
Comment 5 Flor 2010-01-25 03:47:06 UTC
(In reply to comment #2)
> Can you list (ls or ls -l) files under /home/oracle/aplicacion/ ?
> Or can you cat (cat /home/oracle/aplicacion/) one of the mixed case files
> without going via URL?
> What is the version of cifs client that you are using (modinfo cifs)

The problem isn’t with linux commands that with nocase works ok , it’s with URL(with prpconexion.fmx in lower case doesn’t work) ---
Comment 6 shirishpargaonkar@gmail.com 2010-01-25 17:58:25 UTC
One more question, does file PRPCONEXION.fmx reside on the share mounted
using cifs filesytem (i.e either under /home/oracle/aplicacion on the client
machine or under aplicacion on the server machine)?
I am still not sure what is the connection between cifs share and the URL
and why this is a cifs client's problem!
Comment 7 Flor 2010-01-26 02:53:52 UTC
(In reply to comment #6)
> One more question, does file PRPCONEXION.fmx reside on the share mounted
> using cifs filesytem (i.e either under /home/oracle/aplicacion on the client
> machine or under aplicacion on the server machine)?
> I am still not sure what is the connection between cifs share and the URL
> and why this is a cifs client's problem!

Yes, /home/oracle/aplicacion is on the client machine and is mounted using cifs file system, and the problem is with any URL; the URL must be writing in the same way that is writing in the file system.
Comment 8 shirishpargaonkar@gmail.com 2010-02-02 06:33:26 UTC
If you disable unix extension, do you still have problems accessing the
file PRPCONEXION.fmx?
Can you list the file PRPCONEXION.fmx or prpconexion.fmx using ls command
after you mount that particular Samba share using cifs with nocase mount option?
Comment 9 shirishpargaonkar@gmail.com 2010-02-02 17:16:10 UTC
what I do not understand is, how is it possible to cat a file in a 
case insensitive way (since cifs mount is used with option nocase) but
the .fmx file can't be accessed in a case insensitive way which 
presumably exists on the same cifs mounted share!
Comment 10 Flor 2010-02-03 06:23:41 UTC
With linux command we don't have problems with upper/lower case, the problem is only with any URL by example: http://forms.prpmalaga/Index.php in this case you must write the URL in the same way that is writing in the file system.
Comment 11 shirishpargaonkar@gmail.com 2010-02-03 10:11:24 UTC
OK, there must be a difference when a http protocol tries to access
a file and ls -l tries to access a file.
Would be useful if you can generate and attach two wireshark traces,

1  accessing a file as you do when you access it in an URL
2  accessing that same file via command line like 
   ls -l <mount_path>/file_name (as used in the URL)

Will do some debugging on my side as well.
Comment 12 shirishpargaonkar@gmail.com 2010-02-05 11:24:30 UTC
In case of mount option nocase, cifs vfs client as it should,
sets the field
 Case Sensitivity: Path names are caseless
as 1 in the flag field of the smb header and does not set that
field in case mount option nocase is not specified.

I do not think cifs vfs client can do much beyond that. The
onus is on the server (e.g. Samba) after that to handle such requests.
Comment 13 shirishpargaonkar@gmail.com 2010-02-08 16:02:08 UTC
Can you,

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
Comment 14 shirishpargaonkar@gmail.com 2010-02-12 12:22:07 UTC
Created attachment 5337 [details]
patch to indicase server about file names case sensitivity

Include Case Sensitivity flag in smb header's flag field in case of mount
with nocase option.
Comment 15 shirishpargaonkar@gmail.com 2010-02-12 12:27:51 UTC
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  
object_not_found.
Comment 16 shirishpargaonkar@gmail.com 2010-02-12 14:00:04 UTC
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)
  create_file_unixpath: NT_STATUS_OBJECT_NAME_NOT_FOUND
Comment 17 Jeff Layton 2010-02-12 16:27:09 UTC
Assuming that you've inspected the packets and verified that the case insensitive bit is set, you might want to try setting "case sensitive = no" in smb.conf. If that makes it work, then maybe there's something wrong in the case autonegotiation code server side?
Comment 18 shirishpargaonkar@gmail.com 2010-02-14 08:52:02 UTC
I do have that option, "case sensitive = no" in smb.conf.
The error happens (object not found) inspite of that.
And case sensitivity bit is set in smb header's Flag field during
requsts such as NT Create AndX (to open a file) such as Tree Connect.
With the patch I posted, Case Sensitivity bit is set during
Tree Connect but that is probably not necessary i.e. the that patch
is not needed to overcome this problem.