mount.cifs does not handle umlauts in usernames correctly

Bug #414865 reported by Joachim Breitner
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-vfs (Ubuntu)
New
Undecided
Unassigned
samba (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: samba

Hi,

I’m trying to deploy Ubuntu Hardy clients in an AD environment. The home directories are mounted on a Samba file server, also running Ubuntu Hardy. Both machines have an UTF-8 locale.

It works fine for users without umlauts in their name, but for user with an umlaut (e.g. „töst“), mount.cifs does not work. smbclient -U töst works just fine, so it seems to be a cifs problem.

The log messages on the server side show that NTLM authentication for the user DOMAIN\T??st is tried, where ?? is actually two strange characters.

Using sec=krb5 did not help here, the server still had a problem with a wrong username.

Revision history for this message
Joachim Breitner (nomeata) wrote :

Looking at http://gitweb.samba.org/?p=jlayton/cifs.git;a=blob;f=fs/cifs/sess.c it seems that in theory, there is support for unicode in NTLM.

I should also add that accessing shares via nautilus (i.e. gnome-vfs) works fine even with an umlaut username.

Revision history for this message
Joachim Breitner (nomeata) wrote :

Passing "-o user=$(echo Töst|iconv -t850)" to mount.cifs instead of just "user=Töst" gives a different error message:
mount error 6 = No such device or address
instead of
mount error 13 = Permission denied
which seems to indicate that this is indeed an encoding issue.

Revision history for this message
Joachim Breitner (nomeata) wrote :

And indeed, doing the same trick for the umlaut in the share name makes mount.cifs successfully mount the share.

Revision history for this message
Joachim Breitner (nomeata) wrote :

A work-around for me is to wrap the mount.cifs-call in pam_mount.conf.xml with the attached script. I know that the quoting is not perfect, so beware.

Revision history for this message
Chuck Short (zulcss) wrote :

Can you try setting the following in the [global] section in your smb.conf to the right configuration for your locale:

dos charset = VAL1
unix charset = VAL2
display charset = VAL3

thanks
chuck

Changed in samba (Ubuntu):
status: New → Incomplete
Revision history for this message
Joachim Breitner (nomeata) wrote :

Hi,

these options are already correct by default, as "testparm -v" says:
unix charset is UTF8, dos charset is 850 and display charset is LOCALE.

Since smbclient and gvfsd work just perfect with umlauts, I think the problem is either the kernel module or mount.cifs.

Probably the kernel module, as the non-utf8-umlaut turns up in /proc/mounts (where it then causes gnomevfsd to fail to start, because it passes this data via dbus and then dbus seems to kill the connection, which is very bad).

Revision history for this message
Joachim Breitner (nomeata) wrote :

Just in case anyone reads this and stumbles over the same error in gnome-vfs, I worked around it with the attached hack (it makes gnome-vfs not query hal for device names from /proc/mounts that start with two slashes).

Revision history for this message
Joachim Breitner (nomeata) wrote :
Chuck Short (zulcss)
Changed in samba (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Chuck Short (zulcss) wrote :

This patch does not apply to samba.

Changed in samba (Ubuntu):
status: Confirmed → Won't Fix
Revision history for this message
Joachim Breitner (nomeata) wrote :

Hi Chuck,

correct, the patch is only tangentially related to the cifs bug, listed here as a helpful hint for other people. But the bug in the cifs file system still prevails, so I’m not sure if Won't Fix is the right tag here...

Greetings,
Joachim

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.