Extended share names to include \\server name
commit3a07149e19c61f4c687833fb8ea403f458470a01
authorSam Liddicott <sam@liddicott.com>
Fri, 7 Nov 2008 15:39:57 +0000 (7 15:39 +0000)
committerSam Liddicott <sam@liddicott.com>
Wed, 10 Dec 2008 10:10:51 +0000 (10 10:10 +0000)
tree6315b8d394cc12205d60ab246811ab5a1c8634d1
parent9664930f35b1285415d9c1ad72a7fe597782979e
Extended share names to include \\server name

For some share backends, like proxy, where the actual shares are
devised at runtime to represent those that exist on another server,
it's nice to automatically create shares based on a share-template
that holds the relevant defaults.

This allows vfs_cifs or vfs_proxy backends to use a different
netbios alias for each server being proxied, so that one smbd
instance and machine account can proxy for lots of servers.

Extended share names allows shares to be defined to include a
netbios name as part of the share name contained in [ ] in the
ini file (or equivalent in the config).

if "extended share names" is enabled, then When make_connection()
tries to load the share section from the config it will check in
this order for:
  \\name.domain\share
  \\name\share
  \\name.domain
  \\name
  share
  *
where "name.domain" is the full actual server name provided by the client,
and "name" is the name truncated at the first dot (if any).

\\name and \\name.domain are useful for backends like cifs and proxy that
pass the actual share request to the proxied server, and so don't need
to have an actual config entry for each actual remote share.

("*" is a literal *, i.e. [*] in the ini file)

if "extended share names" is disabled then only
  share
is checked, as before.

Unless extra \\ or * shares are defined, it will be harmless to enable
extended share names.
source4/param/loadparm.c
source4/param/param.h
source4/smb_server/smb/service.c