[Samba] Re: Problems with Win-Username containing a "Umlaut"

Dragan Krnic dkrnic at lycos.com
Fri May 30 19:39:41 GMT 2003

Ciao Silvio,

>>>> >> >I found out, that this is caused by the "ö" 
>>>> >> >(german Umlaut). If the Username is "Marc 
>>>> >> >Doerner" it'll work, but i'd like to keep it 
>>>> >> >to "Marc Dörner". So: How can I set Umlaut-
>>>> >> >letters in the username map?
>>>> >
>>>> >
>>>> >> I've had that problem and simply have up. His 
>>>> >> actual name is Doerner. But try poking the PC-
>>>> >> ASCII code for "ö" in the username map. What 
>>>> >> code does "ö" have now?
>>>> >
>>>> >
>>>> >How can I set Ascii Codes in the username map? I 
>>>> >know that the "ö" is Hex Code 0xF6 or Decimal 
>>>> >246...
>>>> That's octal 366. You can do something like:
>>>>    echo -en "\0366"
>>>> to produce the character and then poke it somehow 
>>>> at the right place. dd can help.
>>>> But what code is there now?
>>>I typed in echo -en "\0366" and got a "6" back. So 
>>>what to do with this "6"-Code?
>>>How can I use it in the username.map?
>>>Sorry, but i'm really a newbee to linux..
>>That's OK Silvio. As I said I gave up in the previous
>>try and convinced my user Jörg that his name is 
>>really Joerg. That was expedient. Now I'll take up 
>>the case again and shall let you know soon what I've 
>After some head-banging I can't say I understand why
>small o-umlaut (0xf6) gets interpreted by samba in
>6 different ways (as 0xf7, 0x94, 0x99, 0xcd, 0xd6, and
>0xf6) but if you want an unlucky dörner to be able to 
>use samba login and shares there is an ugly
>work-around for that:
>1. his home directory field in /etc/passwd should use 
>0xf7 instead of 0xf6, like this:
>   dörner:x:597:504::/home/d÷rner:/bin/bash
>2. there has to be a duplicate of this /etc/passwd
>line with a small difference - it should use 0x94
>for o-umlaut like this:
>   d~Trner:x:597:504::/home/d÷rner:/bin/bash
>(it looks like a tilde-and-a-T on my screen)
>3. do exactly the same for the respective entry in
>samba/smbpasswd. i.e. duplicate the line for the user
>with o-umlaut and replace the 0xf6 character with
>0x94. The password fields MUST match.
>4. make sure that his home and profile directories use
>0xf7 instead of 0xf6 for the o-umlaut
>With these changes, Mr. Doerner can login as dörner
>if he's so keen about it.
>Other than that, the relevant smb.conf entries are
>   character set = ISO8859-1  
>   path = /profiles/%U
>   path = /home/%U
>There's a little problem when Mr. Doerner wants to
>change his password. He can't. The only person that
>can do it for him is the root.
>I wish someone from Samba team would look into the
>problem even though it only affects 92.5% of the world 
>population in non-USASCII lands.
>PS: You might wonder how you enter those characters.
>The dörner with normal o-umlaut 0xf6 is what you
>usually get when you press the o-umlaut on a German
>keyboard. Lacking that you may try:
>  echo -en "d\0366rner" > /tmp/some.file
>Normally you should have the character 0xf6 as the
>second character in the output file, but you may also 
>check it by typing:
>   dd conv=swab < /tmp/some.file | od -x
>and if you get
>   0000000 64f6 726e 6572
>in response then it worked. Once you have it in a
>file you can easily read it into a vi session with
>the command ":r /tmp/some.file" and move it around
>to where you need it. Perhaps there's even an easier
>way with vi, but I don't know it.
>For the other character 0xf7, which should be used
>in the names of home and profiles directories use 
>0367 instead of 0366.
>For the third character 0x94, which is used for the
>second passwd and smbpasswd entries, use 0224.
>It's messy, I know, but this is the best I could
>do. And don't even try "valid chars" option, it
>makes no difference.

I had a little time for head-banging today so I found
a slightly less ugly work-around. Apparently the 
codepage files "codepage.850" and
"unicode_map.ISO8859-1" are broken. I've enclosed
corrected files in the attachment which you may
install in lieu of the old files but don't just
overwrite the old files - rename them first, because
maybe the old ones may make sense in a different
context (for example, when samba team really fixes
the problem).

With these 2 files installed you can forget all the
different complications I described in my previous
posting and only need to map the user dörner to his 
namesake written with \0224. For example you may type:

echo -en "dörner = d\0224rner" >> /etc/samba/smbusers

His entry in /etc/passwd could be something like:

  dörner:x:597:504:Marc Doerner:/home/dörner:/bin/bash

(note the homonymous home dir) while the 
/etc/samba/smbpasswd may read something like:

  [U          ]:LCT-3ED26C47:

Now the relevant entries in /etc/samba/smb.conf are
(Note the "code page directory" specification. That's 
where you should put the codepages, the old and the
new ones. They are  usually in
/usr/share/samba/codepages although by default they 
should be in ${prefix}/lib/codepages. If you specify 
it, you can put them anywhere):

    code page directory = /var/lib/samba/codepages
    client code page = 850
    path = /home/$U
    path = /profiles/$U

The option "character set" is no more necessary, since 
ISO8859-1 character set will be automatically loaded 

There's still the problem that Mr. Doerner can't 
change his password without the help of the superuser, 
but I hope I'll get that to work too when I find some 
more head-banging time.

Other than that, Mr. Doerner's service (his home
share) only appears to be d÷rner ("d\0367rner"), 
although his login is really "dörner" and his home dir 
is "dörner" too. It's still a little flakey, but soon 
I'll apply some more duct-tape to it and it will 
be "dörner" all the way.

This is a problem that I ducked away from when I
first met it, but there's really no reason to leave
it unfinished.


Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!

More information about the samba mailing list