Unicode weirdness

Benjamin Kuit bj at mcs.uts.edu.au
Wed Feb 10 02:31:00 GMT 1999


I've just tried out the latest CVS release on my settup here.

(Background: my samba server is running on an machine with a different
byte order than my NT workstations)

When I log into a NT workstation, it claims that my profile is
unavailable.

At the command prompt, the (environment?) variable 'logon drive' is the
string '??'.

Similarly the profile path is set to '???????' and some others.

The debug logs show buffers of unicode streams being in the order that
I expect for the intel byte order, ie '\.\.t.h.i.n.g.\.p.r.o.f.i.l.e.'
and etc. 

Looking at lib/util_unistr.c:struni2(), I noticed the change made as
a response to that C00*BE hackaround post, particularly:

SSVAL(p, 0, *buf);

However, it isn't until I change this line to something like

p[0]='\0'; p[1]=*buf;

effectivily REVERSING the byteorder of the stream, that I get my
profile loaded and the logon drive variables set to things other than
'?????'.

I am at a loss as to why this works. Any clues?

Bj

+-------------------------------+--------------------------------------+
|      Benjamin (Bj) Kuit       |  Faculty Of Mathematical             |
|      Systems Programmer       |          and Computing Sciences.     |
|      Phone: 02 9514 1841      |  University of Technology, Sydney    |
|      Mobile: 0412 182 972     |  bj at mcs.uts.edu.au                   |
+-------------------------------+--------------------------------------+


More information about the samba-technical mailing list