[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Tue Jul 3 07:31:02 MDT 2012


The branch, master has been updated
       via  abda9d3 s3: Fix Coverity ID 709217 Dereference after null check
       via  6710e4e s3: Fix Coverity ID 709218 Uninitialized pointer read
       via  3e6d8ac s3:vfs: use smbXsrv_open instead of smbXsrv_open0 in files_struct
       via  f2e8409 s3:vfs: use smbXsrv_tcon instead of smbXsrv_tcon0 in connection_struct.
       via  db0c233 s3:smb: include "smbXsrv.h" before "vfs.h"
       via  e332bfa s3:smbd: Include smbXsrv.h before vfs.h (in smbd.h) so that the smbXsrv structures are available
       via  8a32d62 s3:smbd:smb2: fix prototype of make_connection_smb2() to use smbXsrv_tcon
       via  98ccca8 s3:smbd: include smbXsrv.h before smbd/proto.h to have the smbXsrv_ structs available
       via  bfc38d7 s3:smbd:smb2: change smbXsrv_tcon0  to smbXsrv_tcon in smbd_smb2_request_check_tcon()
       via  cca51e2 s3:smbd:smb2: change smbXsrv_session0 to smbXsrv_session in struct user_struct.
      from  01a425e samba-tool: gpo: Update copyright

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


- Log -----------------------------------------------------------------
commit abda9d334796c34afd53b15348d4ed08bdfef913
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jun 29 13:30:44 2012 +0200

    s3: Fix Coverity ID 709217 Dereference after null check
    
    A few lines before we did check for x != NULL. I think this might
    fix a potential remote crash.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Tue Jul  3 15:30:17 CEST 2012 on sn-devel-104

commit 6710e4edc5d44894ba022a9f6dff4a2acaf24d07
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jun 29 12:37:40 2012 +0200

    s3: Fix Coverity ID 709218 Uninitialized pointer read
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 3e6d8acc9b48ef4de1df08d3103313f27fa41032
Author: Michael Adam <obnox at samba.org>
Date:   Mon Jul 2 14:47:45 2012 +0200

    s3:vfs: use smbXsrv_open instead of smbXsrv_open0 in files_struct

commit f2e8409c4e60a1350ceb7615f0222789991cd1f2
Author: Michael Adam <obnox at samba.org>
Date:   Mon Jul 2 14:46:32 2012 +0200

    s3:vfs: use smbXsrv_tcon instead of smbXsrv_tcon0 in connection_struct.

commit db0c233624e633b3cc1a6e0e44dccc09aaa121f2
Author: Michael Adam <obnox at samba.org>
Date:   Mon Jul 2 16:10:26 2012 +0200

    s3:smb: include "smbXsrv.h" before "vfs.h"
    
    This is still needed as long as smbXsrv_open/_tcon are referenced
    in files_struct and connection_struct respectively. Eventually,
    these structures should not have a backlink to the smb world any more.

commit e332bfaff51e54638bd37cd1fe08e57608e16e86
Author: Michael Adam <obnox at samba.org>
Date:   Mon Jul 2 14:46:00 2012 +0200

    s3:smbd: Include smbXsrv.h before vfs.h (in smbd.h) so that the smbXsrv structures are available
    
    This is currently needed for files_struct and connection_struct
    that contain backlinks to smbXsrv_open and smbXsrv_tcon, respectively.
    Finally, these backlinks to the smb level structures should be removed.

commit 8a32d62abc7c9f514fa3de2c87202ef7b68bd2b5
Author: Michael Adam <obnox at samba.org>
Date:   Mon Jul 2 13:37:07 2012 +0200

    s3:smbd:smb2: fix prototype of make_connection_smb2() to use smbXsrv_tcon
    
    instead of internal smbXsrv_tcon0.

commit 98ccca8dca70b87d04a93c8ef5232a071ab7c2af
Author: Michael Adam <obnox at samba.org>
Date:   Mon Jul 2 14:27:06 2012 +0200

    s3:smbd: include smbXsrv.h before smbd/proto.h to have the smbXsrv_ structs available

commit bfc38d74ccc3a5ca378ef718ae19dfc1a1d05d7e
Author: Michael Adam <obnox at samba.org>
Date:   Mon Jul 2 13:31:12 2012 +0200

    s3:smbd:smb2: change smbXsrv_tcon0  to smbXsrv_tcon in smbd_smb2_request_check_tcon()
    
    smbXsrv_tcon0 is the internal name for the (current) version0 of the
    structure. Externally, only smbXsrv_tcon should be used.

commit cca51e2f55b79227e697fdc8e5b7f277d0e3e9bb
Author: Michael Adam <obnox at samba.org>
Date:   Mon Jul 2 13:25:05 2012 +0200

    s3:smbd:smb2: change smbXsrv_session0 to smbXsrv_session in struct user_struct.
    
    smbXsrv_session0 is the internal name of (current) version 0 of
    the structure. Externally, only smbXsrv_session should be used.

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

Summary of changes:
 source3/include/smb.h      |    6 ++++++
 source3/include/vfs.h      |    4 ++--
 source3/smbd/conn_idle.c   |    5 +++++
 source3/smbd/globals.h     |    2 +-
 source3/smbd/proto.h       |    3 +--
 source3/smbd/smb2_server.c |   14 +++++++++++---
 source3/smbd/smbd.h        |    1 +
 7 files changed, 27 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/smb.h b/source3/include/smb.h
index f58095e..16a4e12 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -154,6 +154,12 @@ struct sys_notify_context {
 /* Include VFS stuff */
 
 #include "smb_acls.h"
+/*
+ * smbXsrv.h: currently needed for vfs.h, as long as
+ * the smbXsrv structures are still referenced as a
+ * backling from files_struct and connection_struct.
+ */
+#include "librpc/gen_ndr/smbXsrv.h"
 #include "vfs.h"
 
 struct current_user {
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index be4399f..6508707 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -186,7 +186,7 @@ struct fd_handle {
 typedef struct files_struct {
 	struct files_struct *next, *prev;
 	uint64_t fnum;
-	struct smbXsrv_open0 *op;
+	struct smbXsrv_open *op;
 	struct connection_struct *conn;
 	struct fd_handle *fh;
 	unsigned int num_smb_operations;
@@ -282,7 +282,7 @@ struct share_params {
 typedef struct connection_struct {
 	struct connection_struct *next, *prev;
 	struct smbd_server_connection *sconn; /* can be NULL */
-	struct smbXsrv_tcon0 *tcon; /* can be NULL */
+	struct smbXsrv_tcon *tcon; /* can be NULL */
 	uint32_t cnum; /* an index passed over the wire */
 	struct share_params *params;
 	bool force_user;
diff --git a/source3/smbd/conn_idle.c b/source3/smbd/conn_idle.c
index 23dcc89..6026366 100644
--- a/source3/smbd/conn_idle.c
+++ b/source3/smbd/conn_idle.c
@@ -105,6 +105,11 @@ void conn_force_tdis(struct smbd_server_connection *sconn, const char *sharename
 
 		next = conn->next;
 
+		if (conn->tcon == NULL) {
+			continue;
+		}
+		tcon = conn->tcon;
+
 		if (close_all) {
 			do_close = true;
 		} else if (strequal(lp_servicename(SNUM(conn)), sharename)) {
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index b07ee3a..1f2ee18 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -536,7 +536,7 @@ struct user_struct {
 
 	struct auth_session_info *session_info;
 
-	struct smbXsrv_session0 *session;
+	struct smbXsrv_session *session;
 };
 
 struct smbd_server_connection {
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index 1b28c8b..4279755 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -975,9 +975,8 @@ bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir);
 void load_registry_shares(void);
 int add_home_service(const char *service, const char *username, const char *homedir);
 int find_service(TALLOC_CTX *ctx, const char *service, char **p_service_out);
-struct smbXsrv_tcon0;
 connection_struct *make_connection_smb2(struct smbd_server_connection *sconn,
-					struct smbXsrv_tcon0 *tcon,
+					struct smbXsrv_tcon *tcon,
 					int snum,
 					struct user_struct *vuser,
 					const char *pdev,
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 0abd4fc..653a038 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -1317,7 +1317,7 @@ static NTSTATUS smbd_smb2_request_check_tcon(struct smbd_smb2_request *req)
 	int i = req->current_idx;
 	uint32_t in_flags;
 	uint32_t in_tid;
-	struct smbXsrv_tcon0 *tcon;
+	struct smbXsrv_tcon *tcon;
 	NTSTATUS status;
 	NTTIME now = timeval_to_nttime(&req->request_time);
 
@@ -1594,8 +1594,16 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
 
 	req->do_signing = false;
 	if (flags & SMB2_HDR_FLAG_SIGNED) {
-		struct smbXsrv_connection *conn = x->connection;
-		DATA_BLOB signing_key = x->global->channels[0].signing_key;
+		struct smbXsrv_connection *conn;
+		DATA_BLOB signing_key;
+
+		if (x == NULL) {
+			return smbd_smb2_request_error(
+				req, NT_STATUS_ACCESS_DENIED);
+		}
+
+		conn = x->connection;
+		signing_key = x->global->channels[0].signing_key;
 
 		if (!NT_STATUS_IS_OK(session_status)) {
 			return smbd_smb2_request_error(req, session_status);
diff --git a/source3/smbd/smbd.h b/source3/smbd/smbd.h
index 39952a1..9233fd7 100644
--- a/source3/smbd/smbd.h
+++ b/source3/smbd/smbd.h
@@ -23,6 +23,7 @@ struct dptr_struct;
 struct aio_extra;
 
 #include "smb_acls.h"
+#include "librpc/gen_ndr/smbXsrv.h"
 #include "vfs.h"
 #include "smbd/proto.h"
 #include "locking/proto.h"


-- 
Samba Shared Repository


More information about the samba-cvs mailing list