What is the case for preserving case under Samba ...
jay at metran.cx
Mon Jul 8 01:31:02 GMT 2002
Richard Sharpe wrote:
> On Sun, 7 Jul 2002, Jay Ts wrote:
> > At 3:24 PM -0700 7/7/02, Richard Sharpe wrote:
> > >I want to preserve case sensitive behaviour for NFS and UNIX clients,
> > >while reducing the current high cost to CIFS users of providing
> > >case-insensitive behaviour.
> > You mean, you want case-sensitive clients to receive preserve-cased
> > filenames, and non-case-sensitive clients to receive default-cased
> > filenames ... correct?
> > [...]
> > Conrad Minshall wrote:
> > >> Nice goal.
> > I agree. But, is it possible for Samba to determine which clients
> > are which? This would be necessary, or the administrator would
> > have to set up smb.conf include files explicitly for each client
> > on the network (which would not be a fun maintenance task!).
> It's not really an issue for Samba. It is an issue for the file system.
I think that is an opinion; I'd rather it be handled by Samba,
assuming that is possible.
> Samba is another client of the file system, and it would be nice for
> Samba to be able to say:
> Give me a case-preserving but non-case sensitive view of the file
Be careful of how you use your words -- see my example below of what
happens when you have a messed up implementation that matches your demand. :)
What exactly do you mean by "view"? I've been thinking about this,
and there seems to be a difference between "viewing" a directory
(i.e., getting a directory listing) and requesting an operation
on a file (i.e., creating a file, or opening a file by name).
> The problems that arise are how do you deal with:
> UNIX user creates file foo.txt
> CIFS client opens FOO.TXT and the file system maps that to foo.txt
> CIFS client uses the file and closes it.
> UNIX user now creates file FOO.TXT
> CIFS client opens FOO.TXT again. Which file does it get?
OK, I think I see what you mean here by calling it a filesystem
issue. The filesystem "fix" would disallow creation of files that
map to the same name when viewed in a non-case-sensitive manner.
But, I would vote "no" on that, because it would unreasonably
limit the operations of 'decent' (case sensitive) systems such as Unix.
In your above example, the behavior is like Samba acts now, where for
example, in the Samba 2.2.2 source tree, in the docs/htmldocs directory,
there are these two files:
When I was getting my Samba server set up as a PDC for the first
time, I happened to be looking at these files over a Samba share
from Windows. The two separate files were listed, but no matter
which I double-clicked on, the same one would open! (I think what
is happening is that Samba is offering the two files, but Windows
maps filenames to a default case before opening the file.)
This resulted in a lot of confusion for the user. ;) But, I finally
decided that I wouldn't change anything (except, perhaps, for the code
in Windows that remapped the file names!). It's just a limitation of
having non-case-sensitive clients. That is my opinion, anyway.
Now, what I still don't understand is what you were describing in
your initial message on this subject. You said that your "make"
process was looking in a list of include directories for the files,
and this caused excessive readdir()'s. Can you explain that more
precisely? How is it that the case sensitivity caused the problem?
jay at jayts.cx
More information about the samba-technical