<?xml version="1.0" ?>

<kc>

<title>Samba Traffic</title>

<editor contact="mailto:zbrown@tumblerings.org">Zack Brown</editor>

<issue num="38" date="15 Jan 2001 00:00:00 -0800" />

<headquote><a href="http://samba.org">Samba Homepage</a> | <a
href="http://marc.theaimsgroup.com/#samba">Samba List Archives</a>
| <a href="http://samba.he.net/using_samba/">"Using Samba"</a> | <a
href="http://www.redhat.com/support/docs/tips/Samba-Tips/Samba-Tips.html">Samba
Tips</a> | <a href="http://home.germany.net/101-69082/samba.html">A
Samba Doc Page</a> | <a
href="http://www.uwsg.iu.edu/software/source-docs/faq/Samba-meta-FAQ.html">Samba
Meta-FAQ</a> | <a href="http://www.sgi.com/software/samba/faq.html">Samba
For IRIX FAQ</a></headquote>

<intro>

<p>

Want to help write KC Samba? See the <a href="../author.html">KC Authorship
page</a>, the <a href="index.html">KC Samba homepage</a>, and the <a
href="../summaryfaq.html">Thread Summary FAQ</a>. Send any questions to the
<a href="mailto:kcdevel@zork.net">KCDevel mailing list.</a>

</p>

</intro>

<stats posts="191" size="838" contrib="60" multiples="25" lastweek="0">

<person posts="33" size="151" who="&quot;Christopher R. Hertel&quot; &lt;crh@nts.umn.edu&gt;" />
<person posts="16" size="64" who="Kevin Colby &lt;kevinc@grainsystems.com&gt;" />
<person posts="9" size="46" who="Simo Sorce &lt;simo.sorce@polimi.it&gt;" />
<person posts="9" size="37" who="&quot;Welsh, Armand&quot; &lt;armand.welsh@sscims.com&gt;" />
<person posts="9" size="34" who="&quot;Allen, Michael B (RSCH)&quot; &lt;Michael_B_Allen@ml.com&gt;" />
<person posts="8" size="32" who="Richard Sharpe &lt;sharpe@ns.aus.com&gt;" />
<person posts="7" size="34" who="Steve Langasek &lt;vorlon@netexpress.net&gt;" />
<person posts="7" size="26" who="Michael Sweet &lt;mike@easysw.com&gt;" />
<person posts="6" size="30" who="&quot;Armand Welsh&quot; &lt;armand@welshhome.org&gt;" />
<person posts="6" size="24" who="&quot;Michael B. Allen&quot; &lt;mballen@erols.com&gt;" />
<person posts="6" size="24" who="&quot;JBCurry&quot; &lt;jbcurry@hline.localhealth.net&gt;" />
<person posts="6" size="23" who="Charles Crawford &lt;ccrawford@atsengineers.com&gt;" />
<person posts="6" size="20" who="David Bannon &lt;D.Bannon@latrobe.edu.au&gt;" />
<person posts="4" size="18" who="Pat &lt;slu@firerun.net&gt;" />
<person posts="3" size="14" who="&quot;Shawn Wright&quot; &lt;swright@sls.bc.ca&gt;" />
<person posts="3" size="12" who="Gerald Carter &lt;gcarter@valinux.com&gt;" />
<person posts="2" size="40" who="Kenichi Okuyama &lt;okuyamak@dd.iij4u.or.jp&gt;" />
<person posts="2" size="12" who="Tomas Maly &lt;malyprogservices@flashmail.com&gt;" />
<person posts="2" size="12" who="&lt;scritch@altern.org&gt;" />
<person posts="2" size="7" who="&quot;Lohmueller Ralph (QI/LBS2-RT) *&quot; &lt;Ralph.Lohmueller@de.bosch.com&gt;" />
<person posts="2" size="7" who="Yasuhito KAMINAGA &lt;kaminaga@nat.gunma-ct.ac.jp&gt;" />
<person posts="2" size="6" who="Patrick &lt;slu@firerun.net&gt;" />
<person posts="2" size="6" who="Stephane Monlibert - Sun france - ES - Support Engineer &lt;Stephane.Monlibert@france.sun.com&gt;" />
<person posts="2" size="5" who="&quot;Bruno Miguel&quot; &lt;brunomiguel@netcabo.pt&gt;" />
<person posts="2" size="5" who="Muhammad Chatta &lt;muhammadchatta@yahoo.com&gt;" />
<person posts="1" size="6" who="&quot;Nelson Garcia&quot; &lt;garcian002@hawaii.rr.com&gt;" />
<person posts="1" size="6" who="Avantel Systems &lt;alex@avantel.ca&gt;" />
<person posts="1" size="6" who="&quot;Makis Marmaridis&quot; &lt;a9700671@sp4.macarthur.uws.EDU.AU&gt;" />
<person posts="1" size="5" who="&quot;Valentin Pavlov&quot; &lt;v_valchev@prosyst.bg&gt;" />
<person posts="1" size="5" who="Christian Hergl &lt;weehawk@weehawk.de&gt;" />
<person posts="1" size="5" who="&quot;John E. Malmberg&quot; &lt;MALMBERG@Eisner.DECUS.org&gt;" />
<person posts="1" size="4" who="&quot;Eoin Verling&quot; &lt;everling@comnitel.com&gt;" />
<person posts="1" size="4" who="George Cameron &lt;g.cameron@biomed.abdn.ac.uk&gt;" />
<person posts="1" size="4" who="ctooley@amoa.org" />
<person posts="1" size="4" who="David Taubner &lt;DTaubner@exchange.hsc.mb.ca&gt;" />
<person posts="1" size="4" who="&quot;Cole, Timothy D.&quot; &lt;timothy_d_cole@md.northgrum.com&gt;" />
<person posts="1" size="4" who="&quot;Anders C. Thorsen&quot; &lt;anders@cwd.no&gt;" />
<person posts="1" size="4" who="&quot;Michael E Osborne&quot; &lt;mosborne@jacads.com&gt;" />
<person posts="1" size="3" who="&quot;Robert F. Thomas&quot; &lt;RFT@asthomas.com&gt;" />
<person posts="1" size="3" who="Matthew Geddes &lt;mgeddes@xavier.sa.edu.au&gt;" />
<person posts="1" size="3" who="&quot;John E. Malmberg&quot; &lt;wb8tyw@qsl.net&gt;" />
<person posts="1" size="3" who="merkes@t-online.de (markus stephany)" />
<person posts="1" size="3" who="Volker Lendecke &lt;Volker.Lendecke@SerNet.DE&gt;" />
<person posts="1" size="3" who="&quot;Brent DiNicola&quot; &lt;brentd@cicada-semi.com&gt;" />
<person posts="1" size="3" who="Gary McNickle &lt;gary@sunstorm.net&gt;" />
<person posts="1" size="3" who="Grotnes Per Kjetil PBE-SIT &lt;PerKjetil.Grotnes@pbe.oslo.kommune.no&gt;" />
<person posts="1" size="3" who="&quot;Dave Leffler&quot; &lt;dleffler@alaska.com&gt;" />
<person posts="1" size="3" who="Wade C Blackwell &lt;wadenjen@home.com&gt;" />
<person posts="1" size="3" who="Troy Bowman &lt;tbowman@aros.net&gt;" />
<person posts="1" size="3" who="Marc Harding &lt;mharding@ecwebworks.com&gt;" />
<person posts="1" size="3" who="Meir Many &lt;Meir.Many@orange.co.il&gt;" />
<person posts="1" size="3" who="alian &lt;alian@alianwebserver.com&gt;" />
<person posts="1" size="3" who="&quot;Tariq malik&quot; &lt;pcs_tmm@hotmail.com&gt;" />
<person posts="1" size="2" who="John Kristianen &lt;jpk@kristiansen.yi.org&gt;" />
<person posts="1" size="2" who="&quot;Danila Panero&quot; &lt;danilapanero@hotmail.com&gt;" />
<person posts="1" size="2" who="Curtis Nassen &lt;curt.nassen@exchange.athena.net&gt;" />
<person posts="1" size="2" who="Avi Myers &lt;avim@asoft.co.il&gt;" />
<person posts="1" size="2" who="&lt;sambastuff@jabba.glfc.com&gt;" />
<person posts="1" size="2" who="system@niuhep.physics.niu.edu" />

</stats>

<section
  title="URI syntax for smb library"
  author="John Quirk"
  contact="mailto:jq_quirk@hotmail.com"
  subject="Directory listing in libsmbclient.so"
  archive="http://lists.samba.org/pipermail/samba-technical/2000-December/010525.html"
  posts="69"
  startdate="26 Dec 2000 04:46:12 -0800"
  enddate="30 Dec 2000 03:12:59 -0800"
> 
<mention></mention>
<mention>John Quirk</mention>

<p>
<editorialize who="John Quirk">Richard Sharpe has been commissioned by Caldera 
for the development of a Samba client library. The annoucement can be found at 
<a ref="http://au1.samba.org/samba/samba.html">http://au1.samba.org/samba/samba.html</a>.
KC-Samba has reported the start of this library development in issue #34</editorialize>
</p>
<p>Richard Sharpe posted a specification for Directory listing in Libsmbclient.so:</p>

<quote who="Richard Sharpe">
<p>
I am just starting to implement the routines to do directory listings, and
want to be able to support a model that allows the user to list all
workgroups on the network, all servers in a workgroup, all shares on a
server and so on.</p>

<p>We are working with a URI style syntax, and I wanted to propose the following:</p>

<p>  smb:        means list all workgroups on current network</p>

<p>  smb:wg//    means list all servers in workgroup wg</p>
<p>  smb://      means list all servers in your workgroup (as defined in 
$USER/.smb/smb.conf</p>

<p>  smb:[wg]//server means list all shares in server [in wg]</p>

<p>  smb:[wg]//server/share means list all directories at top level of
share on server [in wg]</p>

<p>  smb:[wg]//server/share/path means list all directories in path in share
on server [in wg]</p>

<p>Does anyone have any comments on this ...


</p>

</quote>

<p>
With this there where many posts discussing the above syntax and offering 
suggestions for improvments. Michael Sweet offered this from the CUPS project:

</p>

<quote who="Michael Sweet">

<p>
....
The main difference is (as you can see) that the workgroup shows up
after the // in the URI, which IMHO is a bit more "standard" and
follows the recommended stuff for the file: scheme.
</p>
</quote>
<p>This spawned more variations on this scheme. Michael B. Allen asked in the
course of this discussion is it important to differentiate a workgroup and a domain
to which Steve Langasek replied:</p>

<quote who="Steve Langasek">

<p>
Yes, it is important to differentiate.  If you support specifying a workgroup,
it needs to be done separately from the specification of the domain.
Effectively, 'domain\user' is the username you're using for authentication.
What if a user wishes to browse workgroup2, using his credentials from
domain1?  This should be allowed, and with inter-domain trust relationships it
may even be necessary.
</p>
</quote>

<p>Christopher Hertel added:</p>

<quote who="Christopher Hertel">

<p>
A browse list can be thought of as a directory.  It's not much
different.  The hierarchy would be:</p>


<tt>

<p>workgroup/ntdomain</p>
<p>     \----> Server</p>
<p>              \----> service</p>
<p>                        \----> directory</p>
</tt>

<p>Not unreasonable.  That would give us something like:</p>

<p>  smb://workgroup/[user[:password]@]host[.domain][:port]/[directory/[subdir/]][file]</p>

<p>where workgroup is either a workgroup or ntdomain, and calling up</p>

<p>  smb://</p>

<p>would call up the list of available workgroups/ntdomains, and</p>

<p>  smb://workgroup/</p>

<p>would provide the browse list of a specific workgroup/domain, etc.</p>

</quote>

<p>
There followed many post refining, diverging and adding the 
need for user authentication. Christopher Hertel posted a
summary of where the discussion had reached at this point:</p>

<quote who="Christopher Hertel">

<p>
Yes, I like this idea and I think eveyone else does too.  The basic syntax
that you have outlined is the right track.  Here, I believe, are the
problems that need to be resolved:</p>

<p>- Trust relationships.
  If the ntdomain of the service is different than the user's
  authentication ntdomain, how do we specify both?  Do we need to specify
  both?  Given:</p>

<p>  smb://user:password@domain/server/share/path/file</p>

<p>  The domain field would be the authentication ntdomain, since it is
  associated (via the @) to the user:password.

  As I think of it, since the server name must be unique (even if an IP
  address or DNS name is used) it does not matter which ntdomain the
  server is in.  This may work without having to specify the ntdomain of a
  server.

  Can you connect to a server in a workgroup or ntdomain without
  specifying your own workgroup or ntdomain?  I don't know enough about
  smb authentication...
</p>

<p>- DNS &#38; IP vs NetBIOS naming.
  The /server/ portion should allow for an IP address, a DNS name, or a
  NetBIOS name.   If the latter, then don't forget scope.  The trick here
  is one of knowing how to resolve the name.  It could get messy.</p>

<p>- If the auth field (/user:password@domain/) is missing, can software be
  written to prompt for the missing information?</p>

<p>- Which subfields of the auth field are optional?  Can you type
  /user@domain/ and be prompted for a password (if one is needed)?  Is
  the domain itself required?</p>

</quote>

<p>
Steve Langasek in reply to a comment about overloading the smb URI: 
</p>

<quote who="Steve Langasek">

<p>
I tend to agree with you that browsing shouldn't necessarily be crammed into
the same URI as smb filesharing access.  For one thing, browselists don't
*use* SMB. :)  Unless I'm mistaken, browse lists are assembled and displayed
to the client using only ports 137 and 138, and no SMB packets are ever sent.
So in this sense, I do think it's a bit silly to make these browse lists
available in an smb:// URL.  Consensus seems to be moving toward overloading
the &lt;server&gt; portion of the URL to represent the workgroup as needed, but I
think the ambiguities this introduces, and the complexity of the additional
code for resolving these ambiguities, are still a strong deterrent to this
approach.  We're still a long way from even reaching consensus about *how* the
ambiguity should be resolved.  Give precedence to a workgroup? Give precedence
to a server?  Let the application programmer sort it out?  Display both to the
user and let him decide?  All of these approaches have some merit, but I think
a URL which is unambiguous in the first place has more merit than any other
approach.</p>

<p>Does there need to be a way to textually access the browse list for a
workgroup?  Yes.  Does it need to be a url beginning with `smb://'?  I don't
think it does.  It would be nice if typing smb:// could take us straight to a
list of servers (or of workgroups? Another choice to be made :), but I don't
think this feature's important enough that we should tolerate ambiguous URLs.
</p>

</quote>


<p>
This also generated discussion on how best to do this and was it 
a good idea or not Armand Welsh ended the discussion with:</p>

<quote who="Armand Welsh">


<p>So the question is, can browsing be defined as a funtion of the smb
protocol?  Now that I have put some thaught into it beyond the quick replies
earlier, I would have to say, yes.  Because smb w/o netbios is no longer
smb, but rather CIFS. So if SMB is specific to the netbios service, then
it's probably acceptable to say that workgroup browsing is part of SMB.  So
with that, I reject my previous comments, and position on the use of nmb://
or nbbs://, becase netbios is required by SMB, so it would not be wrong to
wrap it up into one overloaded protocol.  Afterall, we don't use a dns://
protocol to browse dns zones....</p>

</quote>

<p>In reply Christopher Hertel stated:</p>

<quote who="Christopher Hertel">

<p>
Technically, browsing is built on top of the nbt (NetBIOS over TCP/IP)
protocol.  It uses the NetBIOS Name Service and the NetBIOS Datagram
Service.  It does not use either the NetBIOS Session Service or SMB.  That
is why reading a browse list is essentially an overloading of the smb://
URI.
</p>

</quote>

<p> ........ and added ....</p>
<quote who="Christopher Hertel">

<p>Yes, and an interesting conversation.  These issues are certainly not
obvious and do require careful thought.

What a long, strange thread it's been. </p>

</quote>

<p>There followed more discussion on what where legal characters in netbios 
names and how they are represented this finially lead Kevin Colby to this
conclusion:
</p>

<quote who="Kevin Colby">

<p>
Ugh.  We can't very well make that the URI syntax.</p>

<p>Since both the workgroup and the scope could potentially contain
anything at all, there is no possible way to really tell them apart.
(Who thought that up?)  Given the situation, I think Chris mentioned
the only viable solution:  Demand a specific character be escaped if
used in the workgroup or scope name.  Since NT is already starting
to sing a different tune when it sees a ".", that may be the best
nominee for the job.</p>

<p>Just to summarize, I think that leaves two syntaxes:</p>
<p>(broswing) smb://[workgroup[.scope]]/</p>
<p>(specific) smb://[[domain;]user[:password]@]server/[share/[path/][file]]</p>
</quote>
<p>
Steve Langasek added:</p>

<quote who="Steve Langasek">

<p>
With the understanding that 'server' here can be one of
'&lt;netbios_name&gt;[.&lt;scope&gt;]', '&lt;host&gt;[.domain]', or '&lt;ip_addr&gt;', tested in that
order, yes.
</p>
</quote>

<p>Christopher Hertel also added:</p>

<quote who="Christopher Hertel">

<p>The server name also needs to have a scope, as in:</p>

<p>  smb://[[domain;]user[:password]@]server[.scope]/[share/[path/][file]]</p>

<p>This is nasty but true.  As with any NetBIOS name, the name exists
*within* a scope, so the scope must be specified.  In the above, the
first step will be to use the NetBIOS Name Service to resolve the server
name to an IP address so that packets may be sent.  We need to send to
the correct IP address, of course.</p>
</quote>

<p>This thread was finally ended by a post from Richard Sharpe</p>

<quote who="Richard Sharpe">

<strong>
<p>   And thick and fast, they came at last</p>
<p>   and more and more and more</p>
</strong>

<p>Bonus points to those who can tell me where the quote comes from.</p>

<p>NOTE: This document is not the last word on this subject, but I will try to
update it in light of discussions.  It does, however, represent my
reasoning on the subject and reflects what I have gained from the
discussion that went on.</p>

<p>There has been much discussion about the issues of browsing and directory
listing in the libsmbclient library, and I wanted to progress this some
more, and to lay out what I see as the important parts.</p>

<p>Firstly, however, some clarification on browsing.</p>

<p>Browsing involves a complex series of activities and protocols. </p>

<p>On the server side, the NBNS and NBDS are used to register browsing related
names, distribute server and workgroup announcements, and manage the
election of master browsers and backup browsers, etc.</p>

<p>On the client side, however, a broadcast request is sent to the local
master browser NetBIOS name via an IP broadcast to retrieve the backup
browser list, but  after that, Lan Manager requests, like NetServerEnum and
NetShareEnum requests are made after connecting to the IPC$ share on the
browse server.</p>

<p>Indeed, even when you want to see all the domains/workgroups on a network,
a client connects to a backup browser [I think] and sends a NetServerEnum
request on the IPC$ share with a server type of 0x00000000, which causes
Samba, and I assume NT servers, to list the workgroups/domains it knows
about (their NetBIOS names only).</p>

<p>Now, my main concern is whether browsing can or should be unified with
directory listing. A second question is: What should be the form of the URI
used to convey all the required information, both when accessing files but
also when browsing.</p>

<p>However, before doing that, let me say that there is little doubt that
browing a single workgroup should be unified with directory listing; it is
the presence of workgroups/domains that raise problems.</p>

<p>A very clear approach is:</p>

<p>   smb://              means list all servers in the current workgroup.</p>

<p>   smb://server/       means list all shares on server.</p>

<p>   smb://server/share  means list all directories in share on server.</p>

<p>and so on.</p> 

<p>This has the advantage that it conforms to people'e expectations of how
UNCs behave and how URLs behave. The disadvantage is that
workgroups/domains from a browsing perspective do not have a natural place
in this scheme, and they cannot be easily shoehorned in.</p>

<p>As an aside, we should conform to RFC2396 and its URI syntax. This leads to
a very natural addition of authentication information, as RFC2396 provides
for 'userinfo', and provides a natural mechanism for specifying a username
and password, although it cautions against passing such information over
the wire [see below for comments on security].</p>

<p>A more complete form of the syntax, then might be:</p>

<p>  smb://[userinfo@][server[:port]][/share[/path[/file]]]</p>

<p>where &lt;userinfo&gt; could be:</p>

<p>  [user[:password]]</p>

<p>A remaining question, though, is how can the domain (NT domain, that is) of
authentication be indicated in the above &lt;userinfo&gt;. RFC2396 seems to only
allow us a few remaining characters (';', ':', '&#38;', '=', '+', '$', ',') or
we must escape the character we use to mark the presence of a domain in
which the authentication information is relevant.</p>

<p>Unless I have misinterpreted RFC2396, my suggestions would be:</p>

<p>  [user[;domain][:password]]</p>

<p>or</p>

<p>  [user[+domain][:password]]</p>

<p>But I am open to suggestions.</p>

<p>Finally, however, the issue of workgroups/domains intrudes. These would be
most naturally accomodated by supplanting the server down one level, eg:</p>

<p>  smb://[userinfo@][workgroup[/server[/share[/path[/file]]]]]</p>

<p>but this seems unnatural and the objection can be made that DNS-style
domains are not browsed in this way with a normal URI, other mechanisms
must be used to obtain the relevant list of domains.</p>

<p>Thus, my preference now is to exclude workgroups/domains from the URI
syntax, and to use the URI syntax listed above, but I am prepared to listen
to argument.</p>

<p>I would like to provide additional routines to list workgroups, but this
itself may require the provision of authentication information, as the
process of listing the workgroups requires a connection (NetBT) to the
backup browser, and a TCON to the IPC$ share.  This may require a
SessionSetup&amp;X with a valid username and password pair.</p>

<p>An open question at this stage is whether or not this authentication
information should be provided using the callback facility already
provided, or whether or not they should be passed in via parameters.</p>

<p><strong>A NOTE ON NETBIOS NAMES</strong></p>

<p>NetBIOS names are becoming increasingly obsolete. They are only required by
older Microsoft OSes. Samba does not care about NetBIOS names (but does use
them for virtual servers), and NT 4.0 (I believe) and certaily Win2000
allows the use of *SMBSERVER as the called name.</p>

<p>Thus, &lt;server&gt; should be allowed to be a DNS name, with CALLED names being
set to *SMBSERVER, or the first component of the DNS name, or perhaps with
each being tried in turn.</p>

<p><strong>COMMENTS ON SECURITY</strong></p>

<p>There would appear to be less of a security issue, in that these URIs will
not be passed over the wire; they are for specification to the library,
which will pull them apart and use the appropriate pieces where needed. If
the server supports 'encrypted' passwords, then that will be used.</p>

<p>However, the embedding of authentication information in URIs may lead to
harvesting of this information from memory and command lines, so care must
be taken here.</p>

</quote>


<p>
This post started a lively discussion on several new threads that are still
continuing.
</p>

</section>

<section
  title="Smb browsing syntax update"
  author="John Quirk"
  contact="mailto:jq_quirk@hotmail.com"
  subject="libsmbclient: Browsing and a URI spec, updated."
  archive="http://lists.samba.org/pipermail/samba-technical/2001-January/010705.html"
  posts="4"
  startdate="01 Jan 2001 04:19:33 -0800"
  enddate="08 Jan 2001 09:11:32 -0800"
> 
<mention>Simo Sorce</mention>
<mention></mention>
<mention>Kevin Colby</mention>
<mention>Michael Sweet</mention>
<mention>John Quirk</mention>
<mention>Chris Hertel</mention>
<mention>Using Samba</mention>
<mention>Steve Langasek</mention>
<mention>Michael Allen</mention>

<p>Richard Sharpe posted an update to the planned smb: URI syntax</p>

<quote who="Richard Sharpe">
<p>
Caldera has commissioned the development of a Samba client library that
will allow Linux and UNIX programs to be written to access resources on SMB
servers.  The clear goal is to allow the development of applications like
the Windows explorer that allow users to browse resources on Linux/UNIX
systems as well as SMB servers of all types.</p>

<p>There has been much discussion about the issues of browsing and directory
listing in the libsmbclient library, and things are starting to solidify
now.  This document sets out the resolution of the discussion, and
represents what will be developed in libsmbclient.</p>

<p>Firstly, however, some clarification on browsing under Windows.</p>

<p>Browsing involves a complex series of activities and protocols (More
details can be found in Special Edition, Using Samba and Ethereal dissects
many of the SMB calls used to implement browsing).</p>

<p>On the server side, the NBNS and NBDS are used to register browsing related
names, distribute server and workgroup announcements, and manage the
election of master browsers and backup browsers, etc.</p>

<p>On the client side, however, a broadcast request is sent to the local
master browser NetBIOS name via an IP broadcast to retrieve the backup
browser list, but  after that, Lan Manager requests, like NetServerEnum and
NetShareEnum requests are made after connecting to the IPC$ share on the
browse server.</p>

<p>Indeed, even when you want to see all the domains/workgroups on a network,
a client connects to a backup browser and sends a NetServerEnum2 request on
the IPC$ share with a server type of 0x00000000, which causes Samba, and I
assume NT servers, to list the workgroups/domains it knows about (their
NetBIOS names only).</p>

<p>A clear desire with libsmbclient is to be able support browsing as well as
access to resources on servers.  The question is, whether browsing of
workgroups and servers can be unified with browsing of shares and
directories on servers.  If this can be achieved, a single interface can be
provided to users of the libsmbclient library.</p>

<p>By noting that browsing the workgroups on a network is implemented in
exactly the same way as browsing the servers in a workgroup, and that
workgroup and server names are disjoint, we can unify the browsing of
workgroups and servers on a network.</p>

<p>A very clear approach is:</p>

<tt><p>   smb://</p>
<p>      This is the top of the tree. It means list all workgroups.</p>

<p>   smb://server|workgroup/</p>
<p>      Since server names and workgroup names are mutually exclusive,
      list all shares on the server or all servers in the workgroup.
      If the name &lt;workgroup&gt;&lt;1D&gt;has been registered, then list all
      servers in the workgroup, otherwise, if &lt;server&gt;&lt;20&gt; has been
      registered, list all shares on the server.  There are some
      obscure cases where it may be possible for the same name to be
      registered as a server name (eg BADSERVER&lt;20&gt;) and as a local
      master browser name (eg, BADSERVER&lt;1D&gt;), but this would only
      occur in a badly configured network (more discussion here).</p>

<p><strong>      It should be noted here that workgroup also means ntdomain.</strong></p>


<p>   smb://server/share</p>
<p>      List all directories in share on the server.</p>

<p>   smb://server/share/directory</p>
<p>      List all the objects in directory in share on the server.</p></tt>

<p>This has the advantage that it conforms to people'e expectations of how
UNCs behave and how URLs behave, and we get to unify workgroup and server
browsing with directory listings.</p>

<p>As an aside, we should conform to RFC2396 and its URI syntax. This leads to
a very natural addition of authentication information, as RFC2396 provides
for 'userinfo', and provides a natural mechanism for specifying a username
and password, although it cautions against passing such information over
the wire [see below for comments on security].</p>

<p>A more complete form of the syntax, then might be:</p>

<p><tt>  smb://[[userinfo@]server[:port]][/share[/path[/file]]]</tt></p>

<p>where &lt;userinfo&gt; could be:</p>

<p>  [user[:password]]</p>

<p>A remaining question, though, is how can the domain (NT domain, that is) of
authentication be indicated in the above &lt;userinfo&gt;. RFC2396 seems to only
allow us a few remaining characters (';', ':', '&amp;', '=', '+', '$', ',') or
we must escape the character we use to mark the presence of a domain in
which the authentication information is relevant.</p>

<p>The consensus from the list is that the best syntax for &lt;userinfo&gt; is</p>

<p><tt>   [[domain;]user[:password]]</tt></p>

<p>While libsmbclient has a callback to allow authentication information to be
retrieved from the caller, any &lt;userinfo&gt; passed in via the URI may
override that provided via the callback.</p>

<p>The intention is that the smbc_opendir routine would be passed a URI
formatted as above, and it would perform the appropriate operations to
retrieve a browse-list or directory listing.  Subsequent calls to
smbc_readdir would return the next object in the list.  Clearly, with each
dirent returned, there will need to be an indication of the type of object
returned as well.</p>

<p><strong>A NOTE ON NETBIOS NAMES</strong></p>

<p>NetBIOS names are becoming increasingly obsolete. They are only required by
older Microsoft OSes. Samba does not care about NetBIOS names (but does use
them for virtual servers), and NT 4.0 (I believe) and certaily Win2000
allows the use of *SMBSERVER as the called name.</p>

<p>Thus, &lt;server&gt; should be allowed to be a DNS name, with CALLED names being
set to *SMBSERVER, or the first component of the DNS name, or perhaps with
each being tried in turn.</p>

<p>However, browsing of workgroups and servers is all based around NetBIOS
names, so until something like Active Directory is implemented, NetBIOS
names will have to be used.</p>

<p><strong>COMMENTS ON SECURITY</strong></p>

<p>There would appear to be less of a security issue, in that these URIs will
not be passed over the wire; they are for specification to the library,
which will pull them apart and use the appropriate pieces where needed. If
the server supports 'encrypted' passwords, then that will be used.</p>

<p>However, the embedding of authentication information in URIs may lead to
harvesting of this information from memory and command lines, so care must
be taken here.</p>

<p><strong>ACKNOWLEDGMENTS</strong></p>

<p>A number of people have made suggestions and criticisms that have been
incorporated into this document.  I would like to thank Chris Hertel,
Michael Sweet, Michael Allen, Steve Langasek, Simo Sorce and Kevin Colby.
Please accept my apologies if I have missed your contribution.
</p>



</quote>

<p>
Jeremy Allison returned from vacation and added
</p>

<quote who="Jeremy Allison">
<p>
Don't forget to convert from UNIX character set to dos
codepage on entry/exit to the libsmbclient functions. This
took a *lot* of work to get right in previous versions of
the code and needs to be maintained.
</p>
</quote>
<p>This finally ended this very long running thread</p>
<p>
<editorialize who="John Quirk">I have liked following this thread as spread out over a couple of
hundred post! I covered the starting post, skipped the middle sections as much of the
discussion was neatly summerised by the specification as presented by Richard.
If you want to see the how the specification was developed follow the link to the mail archives in
first article.</editorialize>
</p>

</section>

<section
  title="Multiple Logins Required For PDCs"
  author="Zack Brown"
  contact="mailto:zbrown@tumblerings.org"
  subject="samba authentication"
  archive="http://marc.theaimsgroup.com/?l=samba-ntdom&amp;m=97850842624952&amp;w=2"
  posts="6"
  startdate="02 Jan 2001 23:50:39 -0800"
  enddate="11 Jan 2001 10:11:20 -0800"
>

<mention>Armand Welsh</mention>
<mention></mention>

<p>In samba-ntdom, Ami Shamril reported successfully configuring Samba 2.0.6
from Red Hat 6.2 as a PDC. All his Windows 9x users could log into the server,
with one problem: sometimes a user would have to enter the password several
times before the server would authenticate it. Several folks confirmed the
problem, and Armand Welsh replied that running the HEAD CVS branch worked
fine. He recommended upgrading to the latest version in CVS.</p>

</section>

<section
  title="Possible work around to Proceedure Number out of Range with win2k"
  author="John Quirk"
  contact="mailto:jq_quirk@hotmail.com"
  subject="win2k and samba PDC stuff -- bugs?"
  archive="http://lists.samba.org/pipermail/samba-ntdom/2001-January/030885.html"
  posts="1"
  startdate="06 Jan 2001 00:07:13 -0800"
  enddate="06 Jan 2001 00:07:13 -0800"
> 
<mention></mention>
<mention>John Quirk</mention>

<p>
</p>
<p>Patrick Gunerud posted this to samba-ntdom</p>

<quote who="Patrick Gunerud">
<p>
With the success of getting a win2k sp1 machine to join a samba 2.2
PDC I decided to try and build a rpm of samba so I could distribute it
to my other servers with ease.  I immediately ran into problems as soon
as I got the custom rpm installed and configured for my PDC machine.
When I first tried to join the machine to the domain I got a message of
"the credential supplied conflict with a existing set of credentials"
which it happened that the workgroup name I was using was the same as
the domain I was trying to join.  So I changed the workgroup name
rebooted and tried again, which did solve the credentials problem.</p>

<p>The next time I got a message of "The following error occurred
attempting to join the domain 'MY_DOM': The procedure number is out of
range".  I recompiled the rpms several times and each time changing the
configure options until I had the same options the first time I got it
to work.  Needless to say after several hours I could not get that
message to go away.</p>

<p>I then decided to look over the smb.conf file, which this is where I
struck pay dirt.  When I first started I had included the option "unix
password sync = yes" so I could sync my unix passwords with my smb
passwords.  Well when I disabled that option I was able to join the
domain just like before, without the procedure out of range message.</p>

<p>So apparently if you include the "unix password sync = yes" then you
will receive the procedure out of range message when trying to join the
machine to the domain.</p>

<p>If anyone is interested I have samba 2.2 "1/3/2001 cvs" version rpms and
the source rpm on my home machines. They are compiled against redhat
7.0.  Here is the location <a ref="http://www.firerun.net/pub/i386/samba">
http://www.firerun.net/pub/i386/samba</a> </p>



</quote>

<p>
There where no follow up posts.
</p>

<p>
<editorialize who="John Quirk"></editorialize>
</p>

</section>

<section
  title="Problem building libsmbclient"
  author="John Quirk"
  contact="mailto:jq_quirk@hotmail.com"
  subject="building libsmbclient failed"
  archive="http://lists.samba.org/pipermail/samba-technical/2001-January/010886.html"
  posts="2"
  startdate="06 Jan 2001 13:45:16 -0800"
  enddate="06 Jan 2001 12:33:01 -0800"
> 
<mention></mention>

<p>Michael Allen was starting to work with the sources and run into this
problem:</p>

<quote who="Michael Allen">

<tt><p>
Compiling libsmb/namequery.c</p>
<p>libsmb/namequery.c:1022: conflicting types for `get_dc_list'</p>
<p>include/proto.h:441: previous declaration of `get_dc_list'</p>
<p>make: *** [libsmb/namequery.o] Error 1</p>

</tt>



</quote>
<p>
Richard Sharpe replied:
</p>

<quote who="Richard Sharpe">
<p>
OK, I found the problem ... A disconnect between my sources and the CVS
sources meant that I uploaded an incorrect proto.h.</p>

<p>I am fixing now, but you can always do a 'make proto'.</p>
</quote>

</section>

<section
  title="Multiple Domains For Authentication"
  author="Zack Brown"
  contact="mailto:zbrown@tumblerings.org"
  subject="security = server"
  archive="http://marc.theaimsgroup.com/?l=samba-ntdom&amp;m=97946832930692&amp;w=2"
  posts="6"
  startdate="14 Jan 2001 02:32:25 -0800"
  enddate="15 Jan 2001 06:34:33 -0800"
>

<mention></mention>

<p>Sam Silvester used the 'security = server' option, but asked if the
specified server had to be in the same domain, or if disparate servers could
still have all user/group authentication run off of just one of them. Jim
Morris replied that the servers <i>did</i> have to be in the same domain,
and explained, <quote who="Jim Morris">Thats why its a "domain logon"
for Windows. If you want to logon to another domain, you have to log out,
and then log back into Windows specifying the other domain in the domain
portion of the Windows Networking logon dialog.</quote></p>

<p>Stephen Langasek disagreed, saying, <quote who="Stephen Langasek">If
you're only using 'security = server', then your samba server does *not*
have to be in the same domain as the machine it's authenticating against.
Indeed, if you're using 'security = server', your Samba server isn't in a
domain at all.  This is different than the behavior of 'security = domain',
where you'll always be authenticating against the PDC for the domain you're
in.</quote> Jim accepted the correction, and planned on reviewing the
differences between 'server' and 'domain' security with Samba. He asked how to
set up the scenario Stephen had described, but Stephen replied that he hadn't
done it before and didn't know exactly how.</p>

</section>

</kc>

