Samba fc3: accent problem - smbfs vs cifs
Steven French
sfrench at us.ibm.com
Tue Nov 30 01:23:57 GMT 2004
> I found a solution to display the non-english
> characters (é, à, è ...à) correctly in the
> filenames on the server. Based on the /etc/samba/smb.conf and
> the /etc/sysconfig/i18n described at the end of this post, I have
> changed the fstab command line. In some case the
> accent display properly and in others it does not.
> Kind of weird... Here are the test results:
>
>***** if /etc/fstab contains
> //192.168.0.4/bg /mnt/serveur cifs
> user,rw,uid=bgirin,credentials=/etc/samba/pwd_bg 0 0
>
> ->the accent display properly. It also works without the user option.
>
>
>***** if /etc/fstab contains
>//192.168.0.4/bg /mnt/serveur smbfs
>rw,uid=bgirin,credentials=/etc/samba/pwd_bg,codepage=cp850 0 0
>
>->the accent display properly
>
>BUT if /etc/fstab contains
>//192.168.0.4/bg /mnt/serveur smbfs
>user,rw,uid=bgirin,credentials=/etc/samba/pwd_bg,codepage=cp850 0 0
>
>-> it does not work anymore. In that case Nautilus finds that any
>filename containing accent is unicode invalid.
That is interesting data. I would expect cifs vfs to work as long
as:
1) the server supports Unicode on the wire (Samba 3 and later can
support Unicode, as does Windows)
2) the client codepage at mount time (nls charset) - in this case whatever
code page is the default for the process is automounting these entries
needs to be able to handle these entries and it probably should match
the default code page that nautilus was launched under. cifs vfs
also allows overriding the iocharset (the local nls charset used as the
target
of the unicode filename conversions) on the mount parm (similar to what
smbfs did).
There is no need to specify code page.
All that cifs cares about is basically Unicode->nls charset and vice versa
conversions - and the nls charset is taken from what is active when the
mount occurred. Most earlier versions of smbfs did not support Unicode
so they had big problems with client codepage conversions.
There is a bug in the cifs readdir code in unicode translations when the
target
(e.g. UTF-8 encoded file name) is longer than it would be in Unicode
(which is
not that common, but happens often enough to cause problems for multiple
users
who had emailed me). In any case the cifs readdir code is rewritten from
scratch
(available in svn on svn.samba.org in the linux-cifs-client project and
the
master copy is in bk://cifs.bkbits.net/linux-2.5cifs pending additional
testing
before I push it to Linus).
>Note that the when the user option is set-up, gnome automatically
> displays a shortcut to the mounted file on the desktop.
With cifs or with smbfs?
Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: sfrench at-sign us dot ibm dot com
More information about the samba-technical
mailing list