[PATCH} Implement SMB3/SMB3 in smbclient and smbcacls (and generic client library).

Volker Lendecke Volker.Lendecke at SerNet.DE
Sat Aug 10 06:52:20 MDT 2013


On Fri, Aug 09, 2013 at 03:07:27PM -0700, Jeremy Allison wrote:
> So here's the complete patch, broken up into
> (hopefully) reviewable-sized micro-patches.
> 
> It implements full (except for POSIX SMB1 calls
> obviously :-) SMB2/SMB3 support for smbclient
> and smbcacls.
> 
> Test using
> 
> smbclient //server/share -mSMB3
> 
> and you'll get an SMB3 connection.
> 
> I'm hoping to get this reviewed and
> in as OEMs are starting to see customer
> environments where SMB1 is turned off,
> so having our client tools work there
> is obviously very important.

Looks very interesting!

Attached find a patch on top of your patchset that makes
smbclient do the right thing if you have

client max protocol = smb3

in your smb.conf.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 2537f2d8f3e56075636cd4727abeac952c9c0b5d Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Sat, 10 Aug 2013 14:50:02 +0200
Subject: [PATCH] smbclient: Obey "client max protocol" smb.conf option

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/client/client.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/source3/client/client.c b/source3/client/client.c
index 1f63052..37b2937 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -58,7 +58,7 @@ const char *cmd_ptr = NULL;
 static int io_bufsize = 524288;
 
 static int name_type = 0x20;
-static int max_protocol = PROTOCOL_NT1;
+static int max_protocol = -1;
 
 static int process_tok(char *tok);
 static int cmd_help(void);
@@ -5552,6 +5552,10 @@ static int do_message_op(struct user_auth_info *a_info)
 		}
 	}
 
+	if (max_protocol == -1) {
+		max_protocol = lp_cli_maxprotocol();
+	}
+
 	smb_encrypt = get_cmdline_auth_info_smb_encrypt(auth_info);
 	if (!init_names()) {
 		fprintf(stderr, "init_names() failed\n");
-- 
1.7.9.5



More information about the samba-technical mailing list