summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/smb.h2
-rw-r--r--source3/include/smb_macros.h1
-rw-r--r--source3/smbd/process.c8
3 files changed, 9 insertions, 2 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 80b2075651..f96d79fd06 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -412,6 +412,7 @@ typedef struct files_struct {
int fnum;
struct connection_struct *conn;
int fd;
+ unsigned int num_smb_operations;
uint16 rap_print_jobid;
SMB_DEV_T dev;
SMB_INO_T inode;
@@ -533,6 +534,7 @@ typedef struct connection_struct
time_t lastused;
BOOL used;
int num_files_open;
+ unsigned int num_smb_operations; /* Count of smb operations on this tree. */
BOOL case_sensitive;
BOOL case_preserve;
diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h
index ab4ee5ee73..b7a3a68bec 100644
--- a/source3/include/smb_macros.h
+++ b/source3/include/smb_macros.h
@@ -94,6 +94,7 @@
return(ERROR_DOS(ERRDOS,ERRbadfid)); \
else if((fsp)->fd == -1) \
return(ERROR_DOS(ERRDOS,ERRbadaccess));\
+ (fsp)->num_smb_operations++;\
} while(0)
#define CHECK_READ(fsp) if (!(fsp)->can_read) \
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 1bf6f4f9d1..e79686b43e 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -962,8 +962,12 @@ static int switch_message(int type,char *inbuf,char *outbuf,int size,int bufsize
return(ERROR_DOS(ERRSRV,ERRaccess));
/* load service specific parameters */
- if (conn && !set_current_service(conn,SVAL(inbuf,smb_flg),(flags & (AS_USER|DO_CHDIR)?True:False)))
- return(ERROR_DOS(ERRSRV,ERRaccess));
+ if (conn) {
+ if (!set_current_service(conn,SVAL(inbuf,smb_flg),(flags & (AS_USER|DO_CHDIR)?True:False))) {
+ return(ERROR_DOS(ERRSRV,ERRaccess));
+ }
+ conn->num_smb_operations++;
+ }
/* does this protocol need to be run as guest? */
if ((flags & AS_GUEST) && (!change_to_guest() ||