[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Mon Nov 23 08:37:43 MST 2009


The branch, master has been updated
       via  a1a81ef... Revert "s3: Make the implicit reference to Protocol in mask_match() explicit"
       via  d6e55d8... Revert "s3: Make the implicit reference to Protocol in mask_match_list() explicit"
       via  5c4885a... Revert "s3: Make the implicit reference to Protocol in is_in_path() explicit"
       via  7930206... Revert "s3: Make the implicit reference to get_Protocol in lp_use_sendfile() explicit"
       via  0f8e2a6... Revert "s3: Move the global variable Protocol to struct smbd_server_connection"
      from  81c4668... s4:ldap.py - Add a check for the generated "schemaIDGUID"

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


- Log -----------------------------------------------------------------
commit a1a81ef785b2372bd4aab0304150b0f8b0fac247
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 23 16:34:07 2009 +0100

    Revert "s3: Make the implicit reference to Protocol in mask_match() explicit"
    
    This reverts commit e23d8a3d1f558a7e98ef2afd71e1d15c5b3a71bc.

commit d6e55d8ec0335cd2494ca54f1471fad4e2b69795
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 23 16:34:00 2009 +0100

    Revert "s3: Make the implicit reference to Protocol in mask_match_list() explicit"
    
    This reverts commit 1e22899d268ae5a089f941a204413c07ee64fc78.

commit 5c4885a26bbdc1a5086417b63395debd2670db85
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 23 16:33:53 2009 +0100

    Revert "s3: Make the implicit reference to Protocol in is_in_path() explicit"
    
    This reverts commit f7b4151a64d8c6851e62255a7139fd00a5fc63a3.

commit 7930206f5c80b15aded213c3f438ff0120fdea2c
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 23 16:33:45 2009 +0100

    Revert "s3: Make the implicit reference to get_Protocol in lp_use_sendfile() explicit"
    
    This reverts commit 6a149022976fe6a5579ec9afc7a4d2dcb44dc8af.

commit 0f8e2a6ebb716588e741c2cdd8e9918262fdd4c6
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 23 16:33:26 2009 +0100

    Revert "s3: Move the global variable Protocol to struct smbd_server_connection"
    
    This reverts commit c85a4c9ba4a7de65a7850f6f9708df66bd24deea.

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

Summary of changes:
 source3/client/client.c       |    3 +--
 source3/client/clitar.c       |    9 ++-------
 source3/include/proto.h       |   16 ++++++----------
 source3/include/smb.h         |    1 -
 source3/include/smb_macros.h  |    3 +++
 source3/lib/util.c            |   29 ++++++++++++++++++-----------
 source3/modules/onefs_open.c  |    3 +--
 source3/modules/vfs_preopen.c |    3 +--
 source3/param/loadparm.c      |    5 ++---
 source3/smbd/dir.c            |    4 +---
 source3/smbd/dosmode.c        |   12 ++++--------
 source3/smbd/filename.c       |    3 +--
 source3/smbd/globals.c        |   10 ----------
 source3/smbd/globals.h        |    1 -
 source3/smbd/negprot.c        |   13 ++++++-------
 source3/smbd/nttrans.c        |    2 +-
 source3/smbd/open.c           |    5 ++---
 source3/smbd/process.c        |    1 -
 source3/smbd/reply.c          |   28 +++++++++-------------------
 source3/smbd/sesssetup.c      |    4 ++--
 source3/smbd/smb2_negprot.c   |    2 +-
 source3/smbd/trans2.c         |   11 ++++-------
 22 files changed, 65 insertions(+), 103 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/client/client.c b/source3/client/client.c
index 19efa03..6773e6d 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -472,8 +472,7 @@ static bool do_this_one(file_info *finfo)
 	}
 
 	if (*client_get_fileselection() &&
-	    !mask_match(finfo->name, client_get_fileselection(),
-			PROTOCOL_NONE, false)) {
+	    !mask_match(finfo->name,client_get_fileselection(),false)) {
 		DEBUG(3,("mask_match %s failed\n", finfo->name));
 		return false;
 	}
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 7a956f9..d973329 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -827,9 +827,7 @@ static void do_tar(file_info *finfo, const char *dir)
 		DEBUG(5, ("...tar_re_search: %d\n", tar_re_search));
 
 		if ((!tar_re_search && clipfind(cliplist, clipn, exclaim)) ||
-		    (tar_re_search
-		     && mask_match_list(exclaim, cliplist, clipn,
-					PROTOCOL_NONE, True))) {
+				(tar_re_search && mask_match_list(exclaim, cliplist, clipn, True))) {
 			DEBUG(3,("Skipping file %s\n", exclaim));
 			TALLOC_FREE(exclaim);
 			return;
@@ -1212,10 +1210,7 @@ static void do_tarput(void)
 		/* Well, now we have a header, process the file ...            */
 		/* Should we skip the file? We have the long name as well here */
 		skip = clipn && ((!tar_re_search && clipfind(cliplist, clipn, finfo.name) ^ tar_excl) ||
-				 (tar_re_search
-				  && mask_match_list(finfo.name, cliplist,
-						     clipn, PROTOCOL_NONE,
-						     True)));
+					(tar_re_search && mask_match_list(finfo.name, cliplist, clipn, True)));
 
 		DEBUG(5, ("Skip = %i, cliplist=%s, file=%s\n", skip, (cliplist?cliplist[0]:NULL), finfo.name));
 		if (skip) {
diff --git a/source3/include/proto.h b/source3/include/proto.h
index b708c26..88f6dd5 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1073,8 +1073,8 @@ struct passwd *Get_Pwnam_alloc(TALLOC_CTX *mem_ctx, const char *user);
 
 /* The following definitions come from lib/util.c  */
 
-enum protocol_types get_Protocol(const struct smbd_server_connection *c);
-void set_Protocol(struct smbd_server_connection *c, enum protocol_types p);
+enum protocol_types get_Protocol(void);
+void set_Protocol(enum protocol_types  p);
 bool all_zero(const uint8_t *ptr, size_t size);
 bool set_global_myname(const char *myname);
 const char *global_myname(void);
@@ -1156,8 +1156,7 @@ gid_t nametogid(const char *name);
 void smb_panic(const char *const why);
 void log_stack_trace(void);
 const char *readdirname(SMB_STRUCT_DIR *p);
-bool is_in_path(const char *name, name_compare_entry *namelist,
-		enum protocol_types proto, bool case_sensitive);
+bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensitive);
 void set_namearray(name_compare_entry **ppname_array, const char *namelist);
 void free_namearray(name_compare_entry *name_array);
 bool fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
@@ -1187,11 +1186,9 @@ bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent,
 		    const char **name);
 bool ms_has_wild(const char *s);
 bool ms_has_wild_w(const smb_ucs2_t *s);
-bool mask_match(const char *string, const char *pattern,
-		enum protocol_types proto, bool is_case_sensitive);
+bool mask_match(const char *string, const char *pattern, bool is_case_sensitive);
 bool mask_match_search(const char *string, const char *pattern, bool is_case_sensitive);
-bool mask_match_list(const char *string, char **list, int listLen,
-		     enum protocol_types proto, bool is_case_sensitive);
+bool mask_match_list(const char *string, char **list, int listLen, bool is_case_sensitive);
 bool unix_wild_match(const char *pattern, const char *string);
 bool name_to_fqdn(fstring fqdn, const char *name);
 void *talloc_append_blob(TALLOC_CTX *mem_ctx, void *buf, DATA_BLOB blob);
@@ -4387,8 +4384,7 @@ const char *lp_printcapname(void);
 bool lp_disable_spoolss( void );
 void lp_set_spoolss_state( uint32 state );
 uint32 lp_get_spoolss_state( void );
-bool lp_use_sendfile(int snum, enum protocol_types proto,
-		     struct smb_signing_state *signing_state);
+bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state);
 void set_use_sendfile(int snum, bool val);
 void set_store_dos_attributes(int snum, bool val);
 void lp_set_mangling_method(const char *new_method);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 94d2aa2..a3acb7c 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -652,7 +652,6 @@ struct smb_request {
 	size_t unread_bytes;
 	bool encrypted;
 	connection_struct *conn;
-	struct smbd_server_connection *sconn;
 	struct smb_perfcount_data pcd;
 
 	/*
diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h
index 95f427c..10ee78b 100644
--- a/source3/include/smb_macros.h
+++ b/source3/include/smb_macros.h
@@ -79,6 +79,9 @@
 #define MAP_HIDDEN(conn)   ((conn) && lp_map_hidden(SNUM(conn)))
 #define MAP_SYSTEM(conn)   ((conn) && lp_map_system(SNUM(conn)))
 #define MAP_ARCHIVE(conn)   ((conn) && lp_map_archive(SNUM(conn)))
+#define IS_HIDDEN_PATH(conn,path)  ((conn) && is_in_path((path),(conn)->hide_list,(conn)->case_sensitive))
+#define IS_VETO_PATH(conn,path)  ((conn) && is_in_path((path),(conn)->veto_list,(conn)->case_sensitive))
+#define IS_VETO_OPLOCK_PATH(conn,path)  ((conn) && is_in_path((path),(conn)->veto_oplock_list,(conn)->case_sensitive))
 
 /* 
  * Used by the stat cache code to check if a returned
diff --git a/source3/lib/util.c b/source3/lib/util.c
index d194c3a..e0b09c4 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -55,6 +55,18 @@ extern unsigned int global_clobber_region_line;
 #endif /* WITH_NISPLUS_HOME */
 #endif /* HAVE_NETGROUP && WITH_AUTOMOUNT */
 
+static enum protocol_types Protocol = PROTOCOL_COREPLUS;
+
+enum protocol_types get_Protocol(void)
+{
+	return Protocol;
+}
+
+void set_Protocol(enum protocol_types  p)
+{
+	Protocol = p;
+}
+
 static enum remote_arch_types ra_type = RA_UNKNOWN;
 
 /***********************************************************************
@@ -1654,8 +1666,7 @@ const char *readdirname(SMB_STRUCT_DIR *p)
  of a path matches a (possibly wildcarded) entry in a namelist.
 ********************************************************************/
 
-bool is_in_path(const char *name, name_compare_entry *namelist,
-		enum protocol_types proto, bool case_sensitive)
+bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensitive)
 {
 	const char *last_component;
 
@@ -1676,8 +1687,7 @@ bool is_in_path(const char *name, name_compare_entry *namelist,
 
 	for(; namelist->name != NULL; namelist++) {
 		if(namelist->is_wild) {
-			if (mask_match(last_component, namelist->name,
-				       proto, case_sensitive)) {
+			if (mask_match(last_component, namelist->name, case_sensitive)) {
 				DEBUG(8,("is_in_path: mask match succeeded\n"));
 				return True;
 			}
@@ -2374,16 +2384,14 @@ bool ms_has_wild_w(const smb_ucs2_t *s)
  of the ".." name.
 *******************************************************************/
 
-bool mask_match(const char *string, const char *pattern,
-		enum protocol_types proto, bool is_case_sensitive)
+bool mask_match(const char *string, const char *pattern, bool is_case_sensitive)
 {
 	if (ISDOTDOT(string))
 		string = ".";
 	if (ISDOT(pattern))
 		return False;
 
-	return ms_fnmatch(pattern, string, proto <= PROTOCOL_LANMAN2,
-			  is_case_sensitive) == 0;
+	return ms_fnmatch(pattern, string, Protocol <= PROTOCOL_LANMAN2, is_case_sensitive) == 0;
 }
 
 /*******************************************************************
@@ -2407,11 +2415,10 @@ bool mask_match_search(const char *string, const char *pattern, bool is_case_sen
  on each.  Returns True if any of the patterns match.
 *******************************************************************/
 
-bool mask_match_list(const char *string, char **list, int listLen,
-		     enum protocol_types proto, bool is_case_sensitive)
+bool mask_match_list(const char *string, char **list, int listLen, bool is_case_sensitive)
 {
        while (listLen-- > 0) {
-               if (mask_match(string, *list++, proto, is_case_sensitive))
+               if (mask_match(string, *list++, is_case_sensitive))
                        return True;
        }
        return False;
diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c
index 0d786f1..fd12fff 100644
--- a/source3/modules/onefs_open.c
+++ b/source3/modules/onefs_open.c
@@ -603,8 +603,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
 
 	/* Ignore oplock requests if oplocks are disabled. */
 	if (!lp_oplocks(SNUM(conn)) || global_client_failed_oplock_break ||
-	    is_in_path(smb_fname->base_name, conn->veto_oplock_list,
-		       get_Protocol(), conn->case_sensitive)) {
+	    IS_VETO_OPLOCK_PATH(conn, smb_fname->base_name)) {
 		/* Mask off everything except the private Samba bits. */
 		oplock_request &= SAMBA_PRIVATE_OPLOCK_MASK;
 	}
diff --git a/source3/modules/vfs_preopen.c b/source3/modules/vfs_preopen.c
index 1ecbc3a..e545901 100644
--- a/source3/modules/vfs_preopen.c
+++ b/source3/modules/vfs_preopen.c
@@ -395,8 +395,7 @@ static int preopen_open(vfs_handle_struct *handle,
 		return res;
 	}
 
-	if (!is_in_path(smb_fname->base_name, state->preopen_names,
-			get_Protocol(handle->conn->sconn), true)) {
+	if (!is_in_path(smb_fname->base_name, state->preopen_names, true)) {
 		DEBUG(10, ("%s does not match the preopen:names list\n",
 			   smb_fname_str_dbg(smb_fname)));
 		return res;
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index b7eb80e..83c6ef5 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -9714,13 +9714,12 @@ uint32 lp_get_spoolss_state( void )
  Ensure we don't use sendfile if server smb signing is active.
 ********************************************************************/
 
-bool lp_use_sendfile(int snum, enum protocol_types proto,
-		     struct smb_signing_state *signing_state)
+bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state)
 {
 	bool sign_active = false;
 
 	/* Using sendfile blows the brains out of any DOS or Win9x TCP stack... JRA. */
-	if (proto < PROTOCOL_NT1) {
+	if (get_Protocol() < PROTOCOL_NT1) {
 		return false;
 	}
 	if (signing_state) {
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 25ca5e5..5ce4a7b 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -1215,9 +1215,7 @@ bool is_visible_file(connection_struct *conn, const char *dir_path,
 	}
 
 	/* If it's a vetoed file, pretend it doesn't even exist */
-	if (use_veto && is_in_path(name, conn->veto_list,
-				   get_Protocol(conn->sconn),
-				   conn->case_sensitive)) {
+	if (use_veto && IS_VETO_PATH(conn, name)) {
 		DEBUG(10,("is_visible_file: file %s is vetoed.\n", name ));
 		return False;
 	}
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index baf235d..0f31973 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -455,13 +455,11 @@ uint32 dos_mode_msdfs(connection_struct *conn,
 	/* Optimization : Only call is_hidden_path if it's not already
 	   hidden. */
 	if (!(result & aHIDDEN) &&
-	    is_in_path(smb_fname->base_name, conn->hide_list,
-		       get_Protocol(conn->sconn),
-		       conn->case_sensitive)) {
+	    IS_HIDDEN_PATH(conn, smb_fname->base_name)) {
 		result |= aHIDDEN;
 	}
 
-	if (get_Protocol(conn->sconn) <= PROTOCOL_LANMAN2) {
+	if (get_Protocol() <= PROTOCOL_LANMAN2) {
 		DEBUG(10,("dos_mode_msdfs : filtering result 0x%x\n",
 			(unsigned int)result ));
 		result &= 0xff;
@@ -643,13 +641,11 @@ uint32 dos_mode(connection_struct *conn, struct smb_filename *smb_fname)
 	/* Optimization : Only call is_hidden_path if it's not already
 	   hidden. */
 	if (!(result & aHIDDEN) &&
-	    is_in_path(smb_fname->base_name, conn->hide_list,
-		       get_Protocol(conn->sconn),
-		       conn->case_sensitive)) {
+	    IS_HIDDEN_PATH(conn, smb_fname->base_name)) {
 		result |= aHIDDEN;
 	}
 
-	if (get_Protocol(conn->sconn) <= PROTOCOL_LANMAN2) {
+	if (get_Protocol() <= PROTOCOL_LANMAN2) {
 		DEBUG(10,("dos_mode : filtering result 0x%x\n",
 			(unsigned int)result ));
 		result &= 0xff;
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index dd237f1..5d6661d 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -780,8 +780,7 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
 
 NTSTATUS check_name(connection_struct *conn, const char *name)
 {
-	if (is_in_path(name, conn->veto_list, get_Protocol(conn->sconn),
-		       conn->case_sensitive)) {
+	if (IS_VETO_PATH(conn, name))  {
 		/* Is it not dot or dot dot. */
 		if (!((name[0] == '.') && (!name[1] ||
 					(name[1] == '.' && !name[2])))) {
diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c
index f631beb..68fa795 100644
--- a/source3/smbd/globals.c
+++ b/source3/smbd/globals.c
@@ -155,13 +155,3 @@ void smbd_init_globals(void)
 		exit_server("failed to create smbd_server_connection");
 	}
 }
-
-enum protocol_types get_Protocol(const struct smbd_server_connection *c)
-{
-	return c->smb1.negprot.protocol;
-}
-
-void set_Protocol(struct smbd_server_connection *c, enum protocol_types p)
-{
-	c->smb1.negprot.protocol = p;
-}
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 1017ff1..0db61f8 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -446,7 +446,6 @@ struct smbd_server_connection {
 			 * Can be modified by the max xmit parameter.
 			 */
 			int max_recv;
-			enum protocol_types protocol;
 		} negprot;
 
 		struct {
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 8b1355c..81d29d9 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -60,7 +60,7 @@ static void reply_corep(struct smb_request *req, uint16 choice)
 	reply_outbuf(req, 1, 0);
 	SSVAL(req->outbuf, smb_vwv0, choice);
 
-	set_Protocol(req->sconn, PROTOCOL_CORE);
+	set_Protocol(PROTOCOL_CORE);
 }
 
 /****************************************************************************
@@ -80,7 +80,7 @@ static void reply_coreplus(struct smb_request *req, uint16 choice)
 	SCVAL(req->outbuf,smb_flg,FLAG_REPLY|FLAG_SUPPORT_LOCKREAD);
 	SSVAL(req->outbuf,smb_vwv1,0x1); /* user level security, don't
 					  * encrypt */
-	set_Protocol(req->sconn, PROTOCOL_COREPLUS);
+	set_Protocol(PROTOCOL_COREPLUS);
 }
 
 /****************************************************************************
@@ -113,7 +113,7 @@ static void reply_lanman1(struct smb_request *req, uint16 choice)
 		SSVAL(req->outbuf,smb_vwv11, 8);
 	}
 
-	set_Protocol(req->sconn, PROTOCOL_LANMAN1);
+	set_Protocol(PROTOCOL_LANMAN1);
 
 	/* Reply, SMBlockread, SMBwritelock supported. */
 	SCVAL(req->outbuf,smb_flg,FLAG_REPLY|FLAG_SUPPORT_LOCKREAD);
@@ -162,7 +162,7 @@ static void reply_lanman2(struct smb_request *req, uint16 choice)
 		SSVAL(req->outbuf,smb_vwv11, 8);
 	}
 
-	set_Protocol(req->sconn, PROTOCOL_LANMAN2);
+	set_Protocol(PROTOCOL_LANMAN2);
 
 	/* Reply, SMBlockread, SMBwritelock supported. */
 	SCVAL(req->outbuf,smb_flg,FLAG_REPLY|FLAG_SUPPORT_LOCKREAD);
@@ -344,7 +344,7 @@ static void reply_nt1(struct smb_request *req, uint16 choice)
 	SSVAL(req->outbuf,smb_vwv0,choice);
 	SCVAL(req->outbuf,smb_vwv1,secword);
 	
-	set_Protocol(req->sconn, PROTOCOL_NT1);
+	set_Protocol(PROTOCOL_NT1);
 	
 	SSVAL(req->outbuf,smb_vwv1+1,lp_maxmux()); /* maxmpx */
 	SSVAL(req->outbuf,smb_vwv2+1,1); /* num vcs */
@@ -697,8 +697,7 @@ void reply_negprot(struct smb_request *req)
   
 	DEBUG( 5, ( "negprot index=%d\n", choice ) );
 
-	if ((lp_server_signing() == Required)
-	    && (get_Protocol(req->sconn) < PROTOCOL_NT1)) {
+	if ((lp_server_signing() == Required) && (get_Protocol() < PROTOCOL_NT1)) {
 		exit_server_cleanly("SMB signing is required and "
 			"client negotiated a downlevel protocol");
 	}
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 3adc73d..bacb9cb 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -2539,7 +2539,7 @@ static void handle_nttrans(connection_struct *conn,
 			   struct trans_state *state,
 			   struct smb_request *req)
 {
-	if (get_Protocol(conn->sconn) >= PROTOCOL_NT1) {
+	if (get_Protocol() >= PROTOCOL_NT1) {
 		req->flags2 |= 0x40; /* IS_LONG_NAME */
 		SSVAL(req->inbuf,smb_flg2,req->flags2);
 	}
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index f8e1927..911e8fd 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -611,7 +611,7 @@ static NTSTATUS open_file(files_struct *fsp,
 	fsp->is_directory = False;
 	if (conn->aio_write_behind_list &&
 	    is_in_path(smb_fname->base_name, conn->aio_write_behind_list,
-		       get_Protocol(conn->sconn), conn->case_sensitive)) {
+		       conn->case_sensitive)) {
 		fsp->aio_write_behind = True;
 	}
 	status = fsp_set_smb_fname(fsp, smb_fname);
@@ -1569,8 +1569,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
 
 	/* ignore any oplock requests if oplocks are disabled */
 	if (!lp_oplocks(SNUM(conn)) || global_client_failed_oplock_break ||
-	    is_in_path(smb_fname->base_name, conn->veto_oplock_list,
-		       get_Protocol(conn->sconn), conn->case_sensitive)) {
+	    IS_VETO_OPLOCK_PATH(conn, smb_fname->base_name)) {
 		/* Mask off everything except the private Samba bits. */
 		oplock_request &= SAMBA_PRIVATE_OPLOCK_MASK;
 	}
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 730a03d..fbaa9de 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -379,7 +379,6 @@ void init_smb_request(struct smb_request *req,
 	req->unread_bytes = unread_bytes;
 	req->encrypted = encrypted;
 	req->conn = conn_find(sconn,req->tid);
-	req->sconn = smbd_server_conn;
 	req->chain_fsp = NULL;
 	req->chain_outbuf = NULL;
 	req->done = false;
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 49d7497..682f56f 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -785,7 +785,7 @@ void reply_tcon_and_X(struct smb_request *req)
 	else
 		server_devicetype = "A:";
 
-	if (get_Protocol(req->sconn) < PROTOCOL_NT1) {
+	if (get_Protocol() < PROTOCOL_NT1) {
 		reply_outbuf(req, 2, 0);
 		if (message_push_string(&req->outbuf, server_devicetype,
 					STR_TERMINATE|STR_ASCII) == -1) {
@@ -1139,7 +1139,7 @@ void reply_getatr(struct smb_request *req)
 	}
 	SIVAL(req->outbuf,smb_vwv3,(uint32)size);
 
-	if (get_Protocol(req->sconn) >= PROTOCOL_NT1) {
+	if (get_Protocol() >= PROTOCOL_NT1) {
 		SSVAL(req->outbuf, smb_flg2,
 		      SVAL(req->outbuf, smb_flg2) | FLAGS2_IS_LONG_NAME);
 	}
@@ -1264,7 +1264,7 @@ void reply_dskattr(struct smb_request *req)
 
 	reply_outbuf(req, 5, 0);
 
-	if (get_Protocol(req->sconn) <= PROTOCOL_LANMAN2) {
+	if (get_Protocol() <= PROTOCOL_LANMAN2) {
 		double total_space, free_space;
 		/* we need to scale this to a number that DOS6 can handle. We
 		   use floating point so we can handle large drives on systems
@@ -2639,7 +2639,6 @@ NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req,
 			}
 
 			if(!mask_match(dname, fname_mask,
-				       get_Protocol(conn->sconn),
 				       conn->case_sensitive)) {
 				TALLOC_FREE(frame);
 				TALLOC_FREE(talloced);
@@ -2926,8 +2925,7 @@ static void send_file_readbraw(connection_struct *conn,
 
 	if ( !req_is_in_chain(req) && (nread > 0) && (fsp->base_fsp == NULL) &&
 	    (fsp->wcp == NULL) &&
-	     lp_use_sendfile(SNUM(conn), get_Protocol(conn->sconn),
-			     smbd_server_conn->smb1.signing_state) ) {
+	    lp_use_sendfile(SNUM(conn), smbd_server_conn->smb1.signing_state) ) {
 		ssize_t sendfile_read = -1;
 		char header[4];
 		DATA_BLOB header_blob;
@@ -3454,8 +3452,7 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req,
 	if (!req_is_in_chain(req) &&
 	    !is_encrypted_packet(req->inbuf) && (fsp->base_fsp == NULL) &&
 	    (fsp->wcp == NULL) &&
-	    lp_use_sendfile(SNUM(conn), get_Protocol(conn->sconn),
-			    smbd_server_conn->smb1.signing_state) ) {
+	    lp_use_sendfile(SNUM(conn), smbd_server_conn->smb1.signing_state) ) {
 		uint8 headerbuf[smb_size + 12 * 2];
 		DATA_BLOB header;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list