Determining capabilities of peer computer in samba4

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


On Sat, 2005-08-27 at 23:20 -0400, derrell at samba.org wrote:
> derrell at samba.org 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                                http://samba.org/~abartlet/
Samba Developer, SuSE Labs, Novell Inc.        http://suse.de
Authentication Developer, Samba Team           http://samba.org
Student Network Administrator, Hawker College  http://hawkerc.net
-------------- 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 : http://lists.samba.org/archive/samba-technical/attachments/20050828/d42de1ee/attachment.bin


More information about the samba-technical mailing list