[Samba] Problems with lower and uppercase filenames

Barzilai Spinak barspi at internet.com.uy
Sat Sep 28 18:01:01 GMT 2002


Joel Hammer wrote:

>Does this problem with java occur if you save the file to a local directory?
>This sounds like samba is working fine. Your applications are changing the
>case.
>Joel
>  
>
Hi Joel and everybody, I'll try to explain a little better.
First, it's not a problem with Java (I haven't tested any java program 
on this issue), but something I first noticed
when saving files with my Java IDE  (programming environment), working 
from windows on [convoluted] samba share.
(I'll explain the [convoluted] part later just for fun, but it's 
irrelevant to the problem)

The setup is:
WINPUTER sharing a dir called MyWinShare
LINUXPUTER smbmount[ing]  //WINPUTER/MyWinShare  on the local linux dir 
 /mnt/winputer/shareit
LINUXPUTER  sharing /mnt/winputer/shareit  through samba to the rest of 
the LAN
WINPUTER programs trying to create files on the "shareit" share that 
LINUXPUTER publishes (which is
actually on WINPUTER to start with, but it doesn't matter!!)


When creating a file from Wordpad which is a Microsoft Windows program 
(nothing to do with java)
the files are created with ALLCAPS, no matter how you entered them in 
the file save dialog box.
When creating files from Notepad (M$ program) it respects the 
capitalisation.
When using MS Explorer to "drag and copy" a file called foobar.txt, the 
copy becomes "COPY OF FOOBAR.TXT"
When just "dragging and moving" it keeps the capitalisation.
When creating a new file or folder with the windows explorer (right 
click, New, Folder, text document, etc....) or renaming
a file, it respects capitalisation.

<new test>
I map the "shareit" share to a drive letter, say P:
from a DOS prompt I do  "P:\> dir > eEeEeEe"  and it keeps capitalisation
</new test>

Now, nothing like this happens from Windows when writing to a regular 
share that ends up in a normal linux dir (not one that
is smbmount[ed] back to a a Windows machine.
In the same manner, everything is fine when, from the linux prompt I do 
a "ls > eEeEeEEeeeE"  inside the smbmount[ed] directory.
A file with correct capitalisation appears in MyWinShare.

But mix the two together and KAPUT ALL CAPS!!!!  (from some programs, 
not others!!!)

(below is my original post where I explain some of the tests I did with 
codepages and character sets which yielded no change to
this behaviour)


<explanation on my convulted original setup>
In my home linux computer I do:
ssh -2 -C -f -N -g -L 13900:officePC:139 officeLINUX
So I create this SSH tunnel from local linux port 13900 to port 139 in 
my office PC

Then, also in my home linux I do:
mount -t smbfs -o 
username=barspi,port=13900,ip=127.0.0.1,workgroup=OFFICEDOMAIN,fmask=777,dmask=777  
//OFFICEPC/MyShare  /mnt/office/officepc/MyShare/

So now the home linux dir is mounted to my office PC share
I share this local dir with samba and I can access my office PC from any 
PC inside my home network.

Before anyone says it... yes, I know there are things called VPN's and 
all that... but I haven't had time to download/study those
packages and this way let me learn loads of stuff about SSH, samba, etc. 
and it was fun :-)
</explanation on my convulted original setup>

Thank you all!!
BarZ

>On Sat, Sep 28, 2002 at 05:55:25AM -0300, Barzilai Spinak wrote:
>  
>
>>Hi, I just subscribed to this list to see if I can get a solution to the 
>>following problem.
>>I've spent a couple of hours looking though the man pages, google, etc 
>>but haven't found a solution.
>>
>>Platform: RedHat 7.3 and Win98SE (in spanish)
>>Samba Version 2.2.3a
>>
>>Ok, the problem is the following.
>>
>>case 1:
>>Let's say I have a unix directory /temp  shared through samba. I'm 
>>sitting at my windows machine and I can create filenames
>>with upper/lowe/mixed cases and everything works fine
>>
>>case 2:
>>There's a windows shared directory in my windows machine, let's call it  
>>"MyWinShare"
>>I want to access it from unix so I do a  mount -t smbfs -o username=joe 
>> //WINPUTER/MyWinShare /mnt/winputer/shareit
>>
>>now from the unix shell prompt I can create files in my windows machine 
>>with any kind of upper/lower case letters...
>>
>>so far so good...
>>
>>Now I create a samba share:
>>[whatever]
>>path=/mnt/winputer/shareit
>>browseable = yes
>>writable = yes
>>create mask = 0666
>>directory mask = 0777
>>preserve case=yes                ; added this one just in case....
>>
>>
>>The problem starts now. When accessing this share from the Windows 
>>computer I can see the shared directory (although through
>>an unnecesary "loopback" which is irrelevant to the problem because it 
>>still happens with a different setup "without loops").
>>* If I drag and copy a file from the windows explorer, lets say 
>>"foo.txt", the new file becomes "COPY OF FOO.TXT"
>>   All the characters in uppercase.
>>* If I move the file to another directory in the share, the case is kept.
>>* If I rename a file to fOooOo.tXt,  the case is kept.
>>* If I use Notepad and save a new file in the share, it goes all to 
>>UPPERCASE!!!
>>* If I use Wordpad, however, it respects the case...
>>* Other programs behave in different ways...
>>
>>The main problem (and what started all this) is that my Java IDE has the 
>>"all to uppercase" problem and if I edit a file and then save it,
>>the filename goes to UPPER which is very bad for a Java filename since 
>>it's case sensitive.
>>
>>So I read man smb.conf, man smbmount, etc... and saw parameters for 
>>codepages and character sets, and started trying combinations
>>(my windows is in codepage 850 for DOS and codepage 1252 for windows, my 
>>/usr/share/samba/codepages has an entry for 1251 but
>>not for 1252...)
>>Nothing new happens with all the codepage changes, the problem persists.
>>
>>Notice that is not a problem of smb itself because other shares work 
>>fine, nor of smbmount itself because from the unix prompt I can create
>>files in the windows machine with any case of letter. But smb+smbmount, 
>>both together, give this phenomenon!!!
>>
>>any ideas??   I hope this is not too confusing... it's 6:30am already 
>>and I can't even type!
>>
>>thanks
>>
>>BarZ
>>
>>    
>>
>
>
>  
>






More information about the samba mailing list