[Samba] Weird unicode related bug in smbfs?

Adar Dembo adar at stanford.edu
Tue Apr 22 01:07:48 GMT 2003


Dear All,

	I have encountered a strange bug that occurs (I think) with Unicode 
related file names in samba. Let me illustrate the example:

I have a Win2k box with IP 192.168.0.2. This box has an NTFS folder 
called "Music" on it, which is shared for only one user. I have a Debian 
Unstable box with IP 192.168.0.1 which coincidentally acts as the router 
for the Win2k box. Both machines are connected via crossover cable. The 
Linux box has the following line in its /etc/mtab file:

//192.168.0.2/Music /var/ftp-shares/Music/Albums smbfs ro 0 0

And the following line in the /etc/fstab file:

//192.168.0.2/Music	/var/ftp-shares/Music/Albums	smbfs 
credentials=/etc/ftp-credentials/Music,ro	0	0

Using the credentials listed in that "Music" file, the "Music" share is 
mounted into /var/ftp-shares/Music/Albums as an smbfs file system.

Now, the bug. While browsing through the Albums directory, I noticed a 
few irregularities. This is the "ls" output from 
/var/ftp-shares/Music/Albums/Sigur R*s/Von (note that the * is some 
special character that looks like a small c with two lines coming out of 
it, one from the top and one from the bottom):

Sigur R?s - Von - 01 - Sigur R?s.mp3
Sigur R?s - Von - 02 - D?gun.mp3
Sigur R?s - Von - 03 - H?n J?rd.mp3
Sigur R?s - Von - 04 - Leit Ad L?fi.mp3
Sigur R?s - Von - 05 - Myrkur.mp3
Sigur R?s - Von - 06 - 18 Sek?ndur Fyrir S?laruppr?s.mp3
Sigur R?s - Von - 07 - Hafss?l.mp3
Sigur R?s - Von - 08 - Ver?ld Ny Og Od.mp3
Sigur R?s - Von - 09 - Von.mp3
Sigur R?s - Von - 10 - Mistur.mp3
Sigur R?s - Von - 11 - Syndir Guds (Opinberun Frelsarans).mp3
Sigur R?s - Von - 12 - Rukrym.mp3

See how riddled the filenames are with question marks representing 
special (Unicode I think) characters. Now, these files exist on the 
Win2k box. They are valid mp3's that can be played and sound fine. 
However, if I try and copy track #11 to a different location on the 
linux box, this is what I get:

adar at dh2:/var/ftp-shares/Music/Albums/Sigur R¢s/Von$ cp Sigur\ R¢s\ -\ 
Von\ -\ 11\ -\ Syndir\ Guds\ \(Opinberun\ Frelsarans\).mp3 ~/test.mp3
cp: cannot stat `Sigur R\242s - Von - 11 - Syndir Guds (Opinberun 
Frelsarans).mp3': No such file or directory

Now, notice how the character between the 'R' and the 's' is now '\242'.
And when I try and copy track 10:

adar at dh2:/var/ftp-shares/Music/Albums/Sigur R¢s/Von$ cp Sigur\ R¢s\ -\ 
Von\ -\ 10\ -\ Mistur.mp3 ~/test.mp3
adar at dh2:/var/ftp-shares/Music/Albums/Sigur R¢s/Von$

It works just fine. This inconsistency between what files "are there" 
and what files "aren't" is across the board in this directory, some 
files being affected and others not. For the record, in this directory, 
I tried copying all the files and the following failed:

adar at dh2:/var/ftp-shares/Music/Albums/Sigur R¢s/Von$ mkdir ~/test
adar at dh2:/var/ftp-shares/Music/Albums/Sigur R¢s/Von$ cp * ~/test
cp: cannot stat `Sigur R\242s - Von - 03 - H\243n J\224rd.mp3': No such 
file or directory
cp: cannot stat `Sigur R\242s - Von - 04 - Leit Ad L\241fi.mp3': No such 
file or directory
cp: cannot stat `Sigur R\242s - Von - 08 - Ver\224ld Ny Og Od.mp3': No 
such file or directory
cp: cannot stat `Sigur R\242s - Von - 11 - Syndir Guds (Opinberun 
Frelsarans).mp3': No such file or directory

Whereas the others succeeded. Anyone have any idea what is going on, and 
how I might resolve this problem short of renaming everything?

-Adar







More information about the samba mailing list