Netbios name %m not always correct

David Lee t.d.lee at durham.ac.uk
Sat Oct 18 10:53:01 GMT 2003


On Fri, 17 Oct 2003, Christopher R. Hertel wrote:

> On Fri, Oct 17, 2003 at 06:13:54PM +0100, David Lee wrote:
> :
> > Is the following correct?
> >
> > 1. Most PC-to-Samba connections these days use NetBIOS-less SMB (445), so
> >    the PC's smbd session won't have a NetBIOS name available to all.
>
> Depends on your environment.  In corporations that have forced an
> "upgrade" to W2K and above, then it is likely.  In other environments
> (homes, schools, universities, etc.) using the NetBIOS API is probably
> still the default.

Thanks, Chris.  We are mostly XP-based now (also a little residual NT and
earlier for which it would be nice, but perhaps not essential, to cater).

Our general internal guidelines for systems, software, etc. (including
"smb.conf") is to stay with defaults where reasonably practicable, and
only change things which we have good reason to change.  So I guess, in
practice, calls to our smbd arrive on port 445, and therefore there would
be no NetBIOS name available ... Wait a minute, let's do a Solaris network
snoop on a connection establishment ... yes, port 445.

> > 2. For a Samba host to use "SMBsend*" protocol elements back to that same
> >    PC, it requires the NetBIOS name of the PC to open that connection.
>
> There are all sorts of protocols that Microsoft deployed that used the
> NetBIOS API.  Many of them also used SMB packet formats.  The RAP
> protocol, and Mailslot messages were both carried on top of SMB over
> NetBIOS.  All of these protocols had to be dumped or replaced when moving
> away from the NBT layer, since the addressing scheme was based on NetBIOS
> names.
>
> The Browse Service is similar.  The Browse Service is based on NetBIOS and
> NetBIOS names, even though it runs (yet another layer) on top of mailslots
> and RAP.
>
> Much of this infrastructure was replaced by RPC calls.  The RPC calls can
> be carried over a very wide variety of other protocols.  We've seen RPC
> over SMB, RPC over DCOM, RPC over mixed vegitables...

I'll confess that I didn't really follow all that.  But see below: the
intended end-use is a popup message back to the PC.

> > If that is correct, then how might one bridge the gap from "1" to "2"?
> > (Michael is wanting, quite legitimately, to use "smbclient ... %m ..." as
> > part of an "smb.conf" "print command".  And we have other things which
> > have used "smbclient ... %m ..." from "preexec".)
>
> Not sure.  Do you mean that you want to send a pop-up message to a user
> when the print job is completed?

Yes.  The intention in both Michael's case and mine is to send a popup
(historically WinPopup?) message to the PC that has initiated the
connection.  Our configuring smb.conf's "print command" and "preexec" to
do "smbclient -M ... %m ..." is simply a means to achieve that end.

If there is some other (better, more appropriate, etc.) means to that end
we'll happily consider switching to it.  What might it (or they) be?

Slightly off to one side is that the "utmp" aspects of "smbd" (for which,
as its creator, I still have a residual interest and fondness!) now only
seem able to log the IP number, rather than hostname (of any sort).  I
believe (from snippets of emails with Andrew Bartlett some time ago) that
this will be related to 445/no-NetBIOS.  (But don't let this unnecessarily
distract us from the popup message stuff.)

Hints welcome!  Thanks again.


-- 

:  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