Determining capabilities of peer computer in samba4

Andrew Bartlett abartlet at
Sun Aug 28 04:26:55 GMT 2005

On Sat, 2005-08-27 at 23:20 -0400, derrell at wrote:
> derrell at writes:
> > In samba4, how might one discover the capabilities of a peer, to select
> > which of the various "raw" functions to use?  For example, if I want to open
> > a file, is there a way to determine whether I should be using t2open,
> > openold or openx (a few of my choices in union smb_open)?  Similarly for
> > other raw facilities where multiple functions exist.  We clearly want to use
> > the most "recent" or complete function that the peer will accept, but it'd
> > be nice not to have to try them in descending order of preference if there's
> > some better way to figure out which should be used.
> I see that the smbcli_state has an smbcli_transport which has an
> smbcli_negotiate which has a "protocol" which is an enum protocol_types.  It
> looks like I might be able to select the appropriate function based on this
> "protocol" field.  (It's just a lot of levels of indirection into structures
> that I don't feel I should really be looking at when I'm just a client
> library...???)

Part of the problem is that NT 0.12 is a very broad protocol, used by
everything from Win9X to the latest longhorn.  Many of the details of
CIFS are actually dependent on the underlying filesystem (ie a recent
post by sfrench tells me that NTCreate&X is not available on Win95,
despite it using the same 'protocol' as XP).  

I think some clients 'probe' a server to determine what it can take.  In
a similar case, our password change code in Samba4 descends down the
preferred order, looking for RPC faults and the like.

Andrew Bartlett

Andrew Bartlett                      
Samba Developer, SuSE Labs, Novell Inc.
Authentication Developer, Samba Team 
Student Network Administrator, Hawker College
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url :

More information about the samba-technical mailing list