[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Sat Aug 19 03:34:03 UTC 2017


The branch, master has been updated
       via  fe9067b s3:printing: Add NULL check for state_path()
       via  2901ed0 s3:libsmb: let do_connect() debug the negotiation result similar to "session request ok"
       via  ecca957 s3:libsmb: don't call cli_NetServerEnum() on SMB2/3 connections in SMBC_opendir_ctx()
       via  379e5c1 s3:smbclient: don't try any workgroup listing with "client min protocol = SMB2"
       via  3111463 s3:smbclient: improve the error messages for smbclient -L
       via  0f9d102 s3:libsmb: let get_ipc_connect() use CLI_FULL_CONNECTION_FORCE_SMB1
      from  79cfa2e xattr.id: Fix a typo

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fe9067bcc7d605ef0df5721ea290f920f6cf241e
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jul 31 10:09:52 2017 +0200

    s3:printing: Add NULL check for state_path()
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Sat Aug 19 05:33:41 CEST 2017 on sn-devel-144

commit 2901ed0deb1324cacdc804fe5a09468a91661f9d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 16 12:42:48 2017 +0200

    s3:libsmb: let do_connect() debug the negotiation result similar to "session request ok"
    
    Also modify non-specified max_protocol to be PROTOCOL_LATEST
    (currently PROTOCOL_SMB3_11).
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12881
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit ecca95736d3994011de2d3fd882b58ab9b450a83
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 16 12:38:30 2017 +0200

    s3:libsmb: don't call cli_NetServerEnum() on SMB2/3 connections in SMBC_opendir_ctx()
    
    This is all we can do with when using we allow SMB2/3 and the server supports
    it, 'smb://' can't work unless we implement LLMNR and maybe WSD.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12876
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 379e5c1c2fa75c30b08bea7079cf1e9c46db0b26
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 16 08:56:39 2017 +0200

    s3:smbclient: don't try any workgroup listing with "client min protocol = SMB2"
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12863
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 3111463e743dfda89002f1047d1030ab617e5277
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 16 08:55:43 2017 +0200

    s3:smbclient: improve the error messages for smbclient -L
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12863
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 0f9d10246071160dc736205af234ab0ca456d0dc
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Jul 8 00:57:59 2017 +0200

    s3:libsmb: let get_ipc_connect() use CLI_FULL_CONNECTION_FORCE_SMB1
    
    get_ipc_connect() is only used in code paths that require cli_NetServerEnum()
    to work, so it must already require SMB1 only.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12876
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/client/client.c        | 16 ++++++++++------
 source3/libsmb/cliconnect.c    |  2 ++
 source3/libsmb/clidfs.c        |  9 +++++++--
 source3/libsmb/libsmb_dir.c    | 13 +++++++++++++
 source3/printing/nt_printing.c | 17 +++++++++++++++++
 5 files changed, 49 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/client/client.c b/source3/client/client.c
index 83d9b9d..5ef9ad5 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -5829,7 +5829,13 @@ static int do_host_query(const char *query_host)
 		}
 	}
 
+	if (lp_client_min_protocol() > PROTOCOL_NT1) {
+		d_printf("SMB1 disabled -- no workgroup available\n");
+		goto out;
+	}
+
 	if (lp_disable_netbios()) {
+		d_printf("NetBIOS over TCP disabled -- no workgroup available\n");
 		goto out;
 	}
 
@@ -5844,21 +5850,19 @@ static int do_host_query(const char *query_host)
 		 */
 
 		cli_shutdown(cli);
+		d_printf("Reconnecting with SMB1 for workgroup listing.\n");
 		status = cli_cm_open(talloc_tos(), NULL,
 				     have_ip ? dest_ss_str : query_host,
 				     "IPC$", popt_get_cmdline_auth_info(),
 				     smb_encrypt, max_proto,
 				     NBT_SMB_PORT, name_type, &cli);
 		if (!NT_STATUS_IS_OK(status)) {
-			cli = NULL;
+			d_printf("Failed to connect with SMB1 "
+				 "-- no workgroup available\n");
+			return 0;
 		}
 	}
 
-	if (cli == NULL) {
-		d_printf("NetBIOS over TCP disabled -- no workgroup available\n");
-		return 0;
-	}
-
 	cli_set_timeout(cli, io_timeout*1000);
 	list_servers(lp_workgroup());
 out:
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index d98debc..91fd18b 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -3746,6 +3746,8 @@ struct cli_state *get_ipc_connect(char *server,
 		flags |= CLI_FULL_CONNECTION_USE_KERBEROS;
 	}
 
+	flags |= CLI_FULL_CONNECTION_FORCE_SMB1;
+
 	nt_status = cli_full_connection(&cli, NULL, server, server_ss, 0, "IPC$", "IPC", 
 					get_cmdline_auth_info_username(user_info),
 					lp_workgroup(),
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index b740007..5cc220a 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -149,6 +149,7 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
 	const char *domain;
 	NTSTATUS status;
 	int flags = 0;
+	enum protocol_types protocol = PROTOCOL_NONE;
 	int signing_state = get_cmdline_auth_info_signing_state(auth_info);
 	struct cli_credentials *creds = NULL;
 
@@ -204,7 +205,7 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
 	}
 
 	if (max_protocol == 0) {
-		max_protocol = PROTOCOL_NT1;
+		max_protocol = PROTOCOL_LATEST;
 	}
 	DEBUG(4,(" session request ok\n"));
 
@@ -218,8 +219,12 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
 		cli_shutdown(c);
 		return status;
 	}
+	protocol = smbXcli_conn_protocol(c->conn);
+	DEBUG(4,(" negotiated dialect[%s] against server[%s]\n",
+		 smb_protocol_types_string(protocol),
+		 smbXcli_conn_remote_name(c->conn)));
 
-	if (smbXcli_conn_protocol(c->conn) >= PROTOCOL_SMB2_02) {
+	if (protocol >= PROTOCOL_SMB2_02) {
 		/* Ensure we ask for some initial credits. */
 		smb2cli_conn_set_max_credits(c->conn, DEFAULT_SMB2_MAX_CREDITS);
 	}
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index 8038584..72441c4 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -590,6 +590,10 @@ SMBC_opendir_ctx(SMBCCTX *context,
                                 continue;
                         }
 
+			if (smbXcli_conn_protocol(srv->cli->conn) > PROTOCOL_NT1) {
+				continue;
+			}
+
                         dir->srv = srv;
                         dir->dir_type = SMBC_WORKGROUP;
 
@@ -704,6 +708,15 @@ SMBC_opendir_ctx(SMBCCTX *context,
 
 				dir->srv = srv;
 
+				if (smbXcli_conn_protocol(srv->cli->conn) > PROTOCOL_NT1) {
+					if (dir) {
+						SAFE_FREE(dir->fname);
+						SAFE_FREE(dir);
+					}
+					TALLOC_FREE(frame);
+					return NULL;
+				}
+
 				/* Now, list the servers ... */
 				if (!cli_NetServerEnum(srv->cli, wgroup,
                                                        0x0000FFFE, list_fn,
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 0a0d3f7..932d4d7 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -153,20 +153,37 @@ static bool print_driver_directories_init(void)
 	}
 
 	driver_path = state_path("DriverStore");
+	if (driver_path == NULL) {
+		talloc_free(mem_ctx);
+		return false;
+	}
+
 	ok = directory_create_or_exist(driver_path, 0755);
 	if (!ok) {
 		DEBUG(1,("failed to create path %s\n", driver_path));
 		talloc_free(mem_ctx);
 		return false;
 	}
+
 	driver_path = state_path("DriverStore/FileRepository");
+	if (driver_path == NULL) {
+		talloc_free(mem_ctx);
+		return false;
+	}
+
 	ok = directory_create_or_exist(driver_path, 0755);
 	if (!ok) {
 		DEBUG(1,("failed to create path %s\n", driver_path));
 		talloc_free(mem_ctx);
 		return false;
 	}
+
 	driver_path = state_path("DriverStore/Temp");
+	if (driver_path == NULL) {
+		talloc_free(mem_ctx);
+		return false;
+	}
+
 	ok = directory_create_or_exist(driver_path, 0755);
 	if (!ok) {
 		DEBUG(1,("failed to create path %s\n", driver_path));


-- 
Samba Shared Repository



More information about the samba-cvs mailing list