Character set and client code page in samba 2.0.6.
Superuser
opole at pios.gov.pl
Mon Jan 3 15:41:26 GMT 2000
Hello!
I have some troubles with samba 2.0.6 concerning character
set and client code page mapings. I have SCO OpenServer 5.0.5
and I've compiled samba using gcc 2.7.2.3. All Windows
clients use code page 852 and server uses character set
ISO8859-2. For this reason these parametres are set in
smb.conf. This makes possible to copy files with CP852
characters in their names from Windows stations and store
them on server under correctly mapped names with ISO8859-2
characters. From the point of view of the Windows client
everything works OK till this moment. But what will happen if
we try to use smbclient to access Windows PC's share with
CP852 characters in its name? We can invoke smbclient with
share's name written with ISO8859-2 characters and get
connection. In our command all ISO characters are properly
mapped to CP852 ones. But if we now execute dir command, the
result will be completly unreadable. All filenames with CP852
characters will be distorted - some of them will vanish,
others will be mapped unproperly. To examine the problem more
closely, one can use below command to save share's listing in
a file:
./smbclient //PCNAME/ISO8859-2_share -c dir > PC.dir
After opening PC.dir in vi editor we will see that characters
(for example) 0x88 and 0xa5 from CP852, are mapped to ^Z and
character 0x98 is mapped to 0xc2. One could expect that 0x88
is mapped to 0xb3, 0xa5 to 0xb1 and 0x98 to 0xb6 which are
ISO8859-2 equivalents of CP852 characters. Of course, ^Z
mapped characters are not visible on terminal screen.
It is also impossible to get correct result from this
command:
./smbclient //PCNAME/share -c "cd ISO8859-2_dirname;dir"
Where ISO8859-2_dirname is the equivalent of CP852 dirname
existing on a PC. We will get such an error:
cd ISO8859-2_dirname: ERRDOS - ERRbadpath (directory invalid)
To obtain desirable result, we are forced to use such a
trick: we write share's name using ISO8859-2 equivalents of
CP852 characters and CP852 characters of PC dirname. A little
intricate, isn't it? At this moment I gave up and removed
character set = ISO8859-2 and client code page = CP852 lines
from smb.conf, but it occured that PC Windows clients are not
able to copy their files to server if filenames contain CP852
characters.
None of previous 2.x samba versions behaved in this way (I've
stopped using it because of the incredible low speed of put
and get commands). I was able to manipulate the content of
PC's share using ISO8859-2 characters in place of CP852 ones
(although dir command always returned listing with CP852
characters).
Now, when I want to get or put the files to the PC share, I
have to use smbclient from 1.9.18 distribution.
There are two possible explanations of the current situation:
samba 2.0.6 has errors in code pages handling or I have done
something wrong. But what?
K. Hrebeniuk
PS.
And this is what I get when I use 2.0.6 smbclient and Win 3.11:
smb:\> dir
Error: Looping in FIND_NEXT??
ERRSRV - ERRerror(Non specific error code.) listing \*
Any ideas?
-----------------------------------------------
Krzysztof Hrebeniuk
Wojewodzki Inspektorat Ochrony Srodowiska
ul. Nysy Luzyckiej 42
45-035 Opole
tel. (+48)(+77) 454-22-89, 453-99-06; fax: 453-00-69
More information about the samba
mailing list