libsmbclient: Vista servers disconnect on netbios keepalive message on port 445

derrell at samba.org derrell at samba.org
Wed Dec 27 18:41:45 GMT 2006


"Christopher R. Hertel" <crh at ubiqx.mn.org> writes:

> That's why SMB URI scheme supports the :port syntax, as in:
>
>   smb://user@server:port/share/path/file.ext
>                    ^^^^^
>
> The gotcha is a non-standard port.  If the <port> field isn't 139 or 445
> then you don't know which transport is in use until you do a little testing.
> The tests are fairly easy, though, and don't take much time.

Please enlighten me.  What would these tests be?

> Also, as someone else pointed out, it's not clear that an NBT keepalive is
> really needed even when using NBT transport.

So I guess I have a couple of options: I could entirely remove the use of NBT
keepalive requests, or I can use them only if the port is 445.  Or, I can add
those nefarious tests to determine which protocol set is being used.

> Thing is, libsmbclient is supposed to support the SMB URI, so that :port
> syntax should be available to the end user.  Mapping ports through a
> firewall is fairly common practice.

Currently, libsmbclient supports a subset of the spec, specifically:

  smb://[[[domain;]user[:password]@]server[/share[/path[/file]]]][?options]

It does not support "cifs:" and although it knows the concept of options,
currently no local options are supported.  It knows nothing of a port
specifier, so that's currently not being used and we can therefore ignore your
"minor issue".  I've never had a request to add a port specifier, and I'm not
exactly inclined to create work for myself. :-)

> By the way, there is a keepalive parameter in smb.conf.  I don't know
> whether libsmbclient reads that value or not, and the docs don't say what
> value means "turn this off", but I would assume that zero would do the job.

That wouldn't make sense, though, since this would be a per-connection issue,
not a system-wide setting, right?

Cheers,

Derrell


More information about the samba-technical mailing list