libsmbclient and SMB3

Andreas Schneider asn at samba.org
Tue Aug 28 09:27:11 UTC 2018


On Tuesday, 28 August 2018 01:06:26 CEST Jeremy Allison wrote:
> On Mon, Aug 27, 2018 at 07:08:29PM +0200, Andreas Schneider via samba-
technical wrote:
> > Hi,
> > 
> > how can you tell libsmbclient to use SMB3 and why doesn libsmbclient
> > default to SMB1?
> > 
> > 
> > ./bin/smbtorture //addc/tmp -UAdministrator
> > --option=torture:smburl="smb://
> > earth.milkyway.site" libsmbclient.list_shares
> > 
> > 
> > fails with the following error:
> > 
> > 
> > smb1cli_req_writev_submit: called for dialect[SMB3_11]
> > server[earth.milkyway.site]
> > 
> > Which is from libcli/smb/smbXcli_base.c +1681
> > 
> > if (state->conn->protocol > PROTOCOL_NT1) {
> > 
> >    return NT_STATUS_REVISION_MISMATCH;
> > 
> > }
> > 
> > 
> > smbclient -L //earth.milkyway.site -U Administrator
> > 
> > works just fine.
> 
> OK, I'm confused as to what you're expecting here.
> 
> libsmbclient uses the "client max protocol"/"client min protocol"
> settings in the smb.conf, I think it tries to use the max
> protocol selected.
> 
> Are you looking for a command line / smburl method of
> selecting protocol level ?

Ok, I see smbclient reconnects using SMB1 for listing the shares. However it 
produces an error:

bin/smbclient -L //earth.milkyway.site -UAdministrator%Secret007!                                  

        Sharename       Type      Comment
        ---------       ----      -------
        ADMIN$          Disk      Remote Admin
        C$              Disk      Default share
        IPC$            IPC       Remote IPC
        NETLOGON        Disk      Logon server share
        SYSVOL          Disk      Logon server share
Reconnecting with SMB1 for workgroup listing.
Connection to earth.milkyway.site failed (Error 
NT_STATUS_RESOURCE_NAME_NOT_FOUND)
Failed to connect with SMB1 -- no workgroup available

libsmbclient doesn't do the reconnect and fails.


How do you do share listing if SMB1 has been completely disabled, use  
dcerpc_srvsvc_NetShareEnumAll()?


The reason is that I get a lot of bugs which complain about listing shares is 
broken with Nautilus (which uses a gvfs libsmbclient backend).


	Andreas


-- 
Andreas Schneider                      asn at samba.org
Samba Team                             www.samba.org
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D





More information about the samba-technical mailing list