Bug 56 - smbclient -M is broken
smbclient -M is broken
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: smbclient
3.0.0preX
Other other
: P2 normal
: none
Assigned To: Gerald (Jerry) Carter
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-04-30 08:14 UTC by Jelmer Vernooij
Modified: 2005-02-07 07:55 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jelmer Vernooij 2003-04-30 08:14:17 UTC
smbclient -M makes us always send unicode, even when we mark the data as 
ASCII in the SMB packet.
Comment 1 Jelmer Vernooij 2003-04-30 08:17:42 UTC
From an email by David Lee: 
 
On Thu, 24 Apr 2003, Christopher R. Hertel wrote: 
 
> [...] 
> Sounds as though the names are being written in Unicode, which sounds like 
> the wrong thing to do in this case. 
> 
> > #            0: 0003 470e 18ff 0800 2004 c4ea 0800 4500    ..G..... .....E. 
> > #           16: 006e ca27 4000 4006 67f8 81ea 0246 81ea    .n.'@.@.g....F.. 
> > #           32: 0250 804e 008b 7146 2b36 635a b292 5018    .P.N..qF+6cZ..P. 
> > #           48: 60f4 ca0a 0000 0000 0042 ff53 4d42 d500    `........B.SMB.. 
> > #           64: 0000 0008 01c8 0000 0000 0000 0000 0000    ................ 
> > #           80: 0000 ffff 9109 0000 0100 001f 0004 7300    ..............s. 
> > #           96: 6100 6d00 6200 6100 0000 0400 6900 7400    a.m.b.a.....i.t. 
> > #          112: 7300 7000 6300 3800 3000 0000              s.p.c.8.0... 
> 
> Hmmm... Unicode *and* lower case.  Probably both wrong... 
> 
> > Is there some sort of attempt at non-ASCII coding going on here?  (Does 
> > the so-called "Flags2" play a role here?)  What will happen when these 
> > names bump up against the 15-byte transmission limit within SMDsendstrt? 
> 
> [...] 
> Anyway, yes...  The Unicode bit in the Flags2 is set in the second example 
> (Samba 3.0).  The messenger service is old, and probably hasn't been 
> updated for Unicode, so I think that this is wrong. 
 
Many thanks for your reply, Chris. 
 
Subsequent to my original message, I locally hacked (quick'n'dirty) my 3.0 
to try to avoid doing UNICODE, and that seemed successfully to sidestep 
the problem (the "smbclient" message was then successfully transmitted). 
 
Are you able to reproduce the problem and (hopefully, with relative ease) 
confirm changed "on the wire" encoding from Samba 2.2 to 3.0? 
 
Assuming I have hit a genuine problem (which you suggest is probably the 
case) what do we do about it?  I don't know the encoding stuff at all. 
 
Might a possible cure be something relatively simple such as changing 
   p += clistr_push(cli, p, username, -1, STR_TERMINATE); 
   ... 
   p += clistr_push(cli, p, host, -1, STR_TERMINATE); 
to something like: 
   p += clistr_push(cli, p, username, -1, (STR_TERMINATE|STR_ASCII)); 
   ... 
   p += clistr_push(cli, p, host, -1, (STR_TERMINATE|STR_ASCII)); 
 
in "climessage.c"? 
 
Comment 2 Jeremy Allison 2003-05-07 11:19:29 UTC
Fixed this using given patch from David Lee  <t.d.lee@durham.ac.uk>.
Jeremy.
Comment 3 Gerald (Jerry) Carter 2003-05-20 08:23:46 UTC
done
Comment 4 Gerald (Jerry) Carter 2005-02-07 07:55:00 UTC
originally reported against 3.0alpha23.  Bugzilla spring cleaning.