samba-head bug relating to windows special chars (1/2)

Steve Langasek vorlon at
Wed Nov 6 15:48:01 GMT 2002

On Wed, Nov 06, 2002 at 08:35:23PM +1100, Andrew Bartlett wrote:
> On Wed, 2002-11-06 at 19:22, Richard Sharpe wrote:
> > On Wed, 6 Nov 2002, Richard Sharpe wrote:

> > > On Wed, 6 Nov 2002 jra at wrote:
> > > > Oh. Do you have the unix character set set to iso8859-1 ? I
> > > > don't think that character set has a 1/2 character. Try
> > > > setting it to utf8 and see if this fixes it.

> > > Hmmm, Under FreeBSD, that character is encoded as 0xC2 0xBD while under 
> > > Linux it is encoded as 0xAB ...

> > > So, I think it might be a failure to do with the creation of the file in 
> > > the first place ...

> > OK, problem solved. The file name was created under Samba 2.2.x, and then 
> > the profiles were accessed under Samba-head.

> > The translation schemes were different.

> This is going to bite us badly, as sites upgrade.  Is there any way we
> can make this more automatic?

The switch from pass-through to Unicode for the default server charset is
an important enhancement for anyone deploying a new Samba service.  I
think it would be difficult even to support a "backwards compatibility"
mode without reintroducing the 'client code page' option, which is better
off dead, IMHO.

This problem particularly arises with sites that have *never configured*
their charset settings in smb.conf, but are nevertheless using non-ASCII
filenames.  This is ok in 3.0, but was not in 2.2.  Now they switch to
Samba 3.0, which will negotiate Unicode, and suddenly "passthrough" means
UCS-2 -- there's no way to even guess what codepage they were using
before without some nasty filename heuristics, because nothing ever said!

Instead of providing backwards-compatibility for configurations that were
broken in the first place, I think something like the below script, added
to the upgrade documentation, would be better.  The script was written
for Linux (GNU find, GNU bash, GNU iconv :), and probably needs to be
adjusted some for portability -- though something equivalent to iconv is
still required for automatic filename conversion.

Steve Langasek
postmodern programmer

find /path/to/share -type f -exec bash -c 'CP="{}"; ISO=`echo -n "$CP" | iconv -f cp850 \
  -t iso8859-15`; if [ "$CP" != "$ISO" ]; then mv "$CP" "$ISO"; fi' \;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the samba-technical mailing list