Architcecture for winbindd client character conversion.

simo idra at samba.org
Fri Aug 31 12:27:35 GMT 2007


On Fri, 2007-08-31 at 11:43 +0200, Henrik Nordstrom wrote:
> On tis, 2007-08-28 at 12:34 -0400, simo wrote:
> 
> > The bug is in Ubuntu not using utf8 as their default locale or in Ubuntu
> > not setting unix charset = iso8859-1 in smb.conf
> 
> So you are arguing that everyone who has users who do not want utf8 but
> still want to user their local charset, different from the system
> default is broken and should go away?

Almost, the locale determines how file names are written into the file
system for example. if 2 users have different locales file names of one
user can be completely unreadable for the other.

The problem is that locale means 2 things: charset and date, measures
and other conventions. When you use utf8 you get the best as you can
still have the same charset for all and a different set of conventions
for dates, measurements, etc...

> default locale is indeed system wide, but the user selected locale is
> not and may differ. Especially so on systems accepting remote
> connections.

yes, but translating user names in different charset can be very bad, in
current systems that are base on /etc/passwd or nis you never translate
the user name or the home directory path name, no matter what the user
locale is. And this is very import.

Just a very simple example, think of a user with a translated name in
his own locale that do a crontab -e and creates a new personal crontab
file. Now the file name used is going to be the translated name, but the
cron daemon, that run with the system locale knows only of the system
locale version of the name and will probably not be able to run the user
cron job.

> additionally winbind is used by various other networking related
> services which may have their own locale needs, via the ntlm_auth helper
> and wbinfo.

In some veru specific cases it may be handy, but in general translating
user names and home directory paths is simply wrong IMO.

> If I were you I would settle for UTF-8 in all windbind calls regardless
> of the unix charset, and have the clients (including
> pam_wibind,nss_winbind,smbd and ntlm_auth) convert it as needed to their
> locale. Adding negotiation is certainly overkill and not something I
> would recommend, other than possibly to negotiate between "as-is" unix
> charset and utf-8.

The negotiation is not overkill, we already do some negotiation and this
is just like sending down the locale to winbind for it to translate the
stuff, will certainly mean things slower though, think of enumerating
1000 users and translating every single entry, in some pathological case
going from unix charset to utf8/ucs2 to final charset ...

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: idra at samba.org
http://samba.org



More information about the samba-technical mailing list