samba-3.0alpha23: smbclient -M ... ?

David Lee t.d.lee at durham.ac.uk
Tue Apr 29 10:05:59 GMT 2003


On Thu, 24 Apr 2003, Christopher R. Hertel wrote:

> On Thu, Apr 24, 2003 at 05:59:17PM +0100, David Lee wrote:
> > [...]
> > Under 2.2.x the command:
> >    smbclient  -M PC_name  -I ip.no.of.PC
> >
> > could send a WinPopup message to the PC.  But this seems not to work with
> > samba-3.0alpha23.
> >
> > [...]
> > Samba 2.2.x does a nice packet exchange of the various SMBsend* packets.
> >
> > Samba 3.0alpha23 seems only to do the outbound SMBsendstrt, with no
> > corresponding reply from the PC.  Further the "originator name" and
> > "destination name" seem to be expanded up to double length with null
> > bytes.
>
> Sounds as though the names are being written in Unicode, which sounds like
> the wrong thing to do in this case.

Thanks for confirming my suspicions.

>
> > #            0: 0003 470e 18ff 0800 2004 c4ea 0800 4500    ..G..... .....E.
> > #           16: 006e ca27 4000 4006 67f8 81ea 0246 81ea    .n.'@. at .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...
>
> [...]
> 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.


Thanks for your help, Chris.

I have just tried the following patch, which seems to fix the problem for
us.  It forces ASCII, which seems to be a requirement.

But I have not attempted to force upper-case (which presumably would be
OR-ing in "STR_UPPER"), as this seems to introduce an unnecessary (for us,
at least) change into the data (i.e. the names).

Please could someone verify check it and apply it to 3_0.  (And if the
spec. demands upper-case, then apply further tweaks...).


Thanks.

======================== snip ==================
--- climessage.c-       Wed Apr 23 18:00:39 2003
+++ climessage.c        Tue Apr 29 10:49:22 2003
@@ -39,9 +39,9 @@

        p = smb_buf(cli->outbuf);
        *p++ = 4;
-       p += clistr_push(cli, p, username, -1, STR_TERMINATE);
+       p += clistr_push(cli, p, username, -1, (STR_ASCII|STR_TERMINATE));
        *p++ = 4;
-       p += clistr_push(cli, p, host, -1, STR_TERMINATE);
+       p += clistr_push(cli, p, host, -1, (STR_ASCII|STR_TERMINATE));

        cli_setup_bcc(cli, p);

======================== snip ==================



-- 

:  David Lee                                I.T. Service          :
:  Systems Programmer                       Computer Centre       :
:                                           University of Durham  :
:  http://www.dur.ac.uk/t.d.lee/            South Road            :
:                                           Durham                :
:  Phone: +44 191 334 2752                  U.K.                  :


More information about the samba-technical mailing list