[linux-cifs-client] RFC 1001/1002 support

Christopher R. Hertel crh at ubiqx.mn.org
Mon Apr 26 04:36:40 GMT 2004


Steven French wrote:
> 
> The version 1.10 of the cifs vfs (which is quite current and much
> improved) has been merged into the mainline 2.6 kernel tree so will very
> likely be in 2.6.6. There is one additional change that I have made since
> 1.10 that is only in the project bk tree
> (bk://cifs.bkbits.net/linux-2.5cifs) - adding partial support for
> RFC1001/1002.
> 
> Support for RFC1001/RFC1002 session_initialize had been requested by
> multiple people, and is now implemented. Although not full featured (e.g.
> support for the optional "netbios scope" is not enabled), it does allow
> connection over port 139 (not just 445) for servers that require the
> client to send a RFC1001 session initialize.

Steve,

Scope is never included in the NBT Session Request message.  It is only used
in Datagram messages.  I've checked up on this and it is both correct and
consistent behavior for NBT.  You don't need scope.  :)

> Tomorrow I will add the code to allow the "netbiosname" mount parm to
> override the default rfc1001 client name. I also would like to know which
> way of choosing a default netbios name would be preferred and no
> netbiosname override is chosen (this only matters when port 139 is used,
> as the more common port 445 connections does not use this and so port 139
> is typically only used if the firewall filters 445 or if port=139 is
> specified on the mount)

Do you mean the server (CALLED) name?

You really need both the CALLED and CALLING name.  The CALLED name should be
  1) the server's NetBIOS name
  2) if the server's NetBIOS name is not available (eg, DNS name was used)
     then "*SMBSERVER"
  3) if "*SMBSERVER" doesn't work, then there are tricks that can be tried,
     but these are probably more than the CIFS VFS should be using.

The CALLING name should be:
  1) The DNS hostname of the client.
  2) The first label of the DNS name assigned to the IP address of the
     interface from which the request is being sent.
  3) Anything you like.

The CALLING name is sometimes used by Samba to identify the client (for
service selection and/or logging purposes).

The SMB URI allows both the CALLED and CALLING names to be overridden by
user input.

> 1) first component of the client's tcp hostname (truncated to 15 bytes)

Yep.

> 2) mac address of the interface (if I can find a way to request this
> information from the kernel tcp stack)

If all else fails, this is good as it will be unique.

> 3) a hardcoded name (e.g. "LINUX_CIFS_CLNT")

jCIFS uses a hard-coded prefix with a randomized suffix to prevent
collision. It is unlikely, however, that collisions here will ever be
noticed by the system.

> 4) ip4 address of the interface (e.g. "009.003.145.116") which is
> conveniently 15 bytes already and is what server's already display when we
> connect on port 445

That could work too.

> Although currently it is hardcoded ala option 3, I prefer option 4

Option 1 would be the most correct, however.  Note that the suffix byte
should be <00>.

> I also would like to know whether anyone requires the use of
> netbios_scope?

Again, this is not used in the Session Request.  I can explain why, but it's
late and my fingers are tired.

> This change also means that I can test support against NT4 servers soon
> (since this was an obstacle preventing connections to them)

Cool!

Chris -)-----

-- 
"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org


More information about the linux-cifs-client mailing list