[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Jul 10 00:29:02 UTC 2019


The branch, master has been updated
       via  09ddad6c14d s3: smbd: Remove ifdef'ed out dptr_close_oldest().
       via  6134922f7b4 s3: smbd: Remove the 'close oldest' logic in SMB1 trans2 search processing.
       via  1376dc3b840 s3: smbd: Remove the 'close oldest' logic in SMB1search processing.
       via  ff8c8b34b91 s3: smbd: Remove now unused parameter 'forclose' to dptr_get().
       via  e21b75168d3 s3: smbd: globals - remove dirhandles_open from internal search struct.
       via  d9d00ad068c s3: smbd: We no longer need to keep a count of dirhandles open.
       via  096a98f6eab s3: smbd: Add a note explaining MAX_DIRECTORY_HANDLES only applies to SMB1.
       via  ab65fa9af0b s3: smbd: Remove now unused MAX_OPEN_DIRECTORIES define.
       via  288d71678b0 s3: smbd: Remove unused dptr_idleoldest() and dptr_idle() functions.
       via  7b6129d14e4 s3: smbd: Remove SMB1 idle unused directory handles code.
       via  7b98319f305 s3: smbd: Remove MAX_OPEN_DIRECTORIES check in dptr_create().
       via  a43e6771348 s3: smbd: Remove now unused dptr_idlecnum().
       via  80ae1eba8cb s3: smbd: Remove unused DPTR_IDLE_TIMEOUT.
       via  609c9a58ceb s3: smbd: Don't idle SMB1 directory scans after DPTR_IDLE_TIMEOUT.
       via  461001cbc13 s3: smbd: Don't idle connections with active SMB1 directory scans.
       via  abc58a4a128 s3: smbd: Add dptr_activecnum(), not yet used.
      from  ccf3e76625c s3:profile: Allow profile subsystem to use SHA1 in FIPS mode

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


- Log -----------------------------------------------------------------
commit 09ddad6c14db6e3310b663f6203582104d85db45
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 15:28:51 2019 -0700

    s3: smbd: Remove ifdef'ed out dptr_close_oldest().
    
    No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Jul 10 00:28:51 UTC 2019 on sn-devel-184

commit 6134922f7b4d0141e40286c5c5acad05272fa267
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 15:26:59 2019 -0700

    s3: smbd: Remove the 'close oldest' logic in SMB1 trans2 search processing.
    
    Will be removed in next commit.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 1376dc3b840561cd782cd5f228eb1c43aa96f22d
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 15:23:57 2019 -0700

    s3: smbd: Remove the 'close oldest' logic in SMB1search processing.
    
    Expect the client to manage their handles properly.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit ff8c8b34b91ffc5fa9742d57190580cbf64a1afd
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 15:20:42 2019 -0700

    s3: smbd: Remove now unused parameter 'forclose' to dptr_get().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit e21b75168d382500370591b678d1558265b18771
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 15:16:21 2019 -0700

    s3: smbd: globals - remove dirhandles_open from internal search struct.
    
    It wasn't used for SMB2 anyway, and isn't useful for anything.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit d9d00ad068c5814e13c68c7fe42d75242f899f0d
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 15:15:24 2019 -0700

    s3: smbd: We no longer need to keep a count of dirhandles open.
    
    It's not per-connection struct anyway, so doesn't
    help for anything.
    
    Remove now unused variable struct smbd_server_connection *sconn
    otherwise we get compile errors.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 096a98f6eab3ba4be9e24e1f4cc9c6477983c282
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 15:06:30 2019 -0700

    s3: smbd: Add a note explaining MAX_DIRECTORY_HANDLES only applies to SMB1.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit ab65fa9af0ba97fdc5f0e44eea9652212f0f7cd0
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 15:06:07 2019 -0700

    s3: smbd: Remove now unused MAX_OPEN_DIRECTORIES define.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 288d71678b02effdb910e8ebb811d0f502a75166
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 15:35:20 2019 -0700

    s3: smbd: Remove unused dptr_idleoldest() and dptr_idle() functions.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 7b6129d14e4d22728c009ec72529f6f18010db68
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 15:34:41 2019 -0700

    s3: smbd: Remove SMB1 idle unused directory handles code.
    
    This is only needed for broken SMB1 DOS clients, and
    we're a long way from needing this anymore.
    
    ifdef out dptr_idleoldest() and dptr_idle()
    functions as otherwise we get "unused function"
    compile errors. Remove in next commit.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 7b98319f3057bea2e78be7b540f640fc476c770c
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 15:01:43 2019 -0700

    s3: smbd: Remove MAX_OPEN_DIRECTORIES check in dptr_create().
    
    This is a bug in that it's artificially limiting the number
    of open directories an SMB2 client can have. If this code
    was needed it should by SMB1 specific.
    
    However we should allow the clients to decide for themselves
    how many directory handles they need, not limit to MAX_OPEN_DIRECTORIES.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit a43e6771348127dd2e3fd3efcc8e0b5691916862
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 14:58:44 2019 -0700

    s3: smbd: Remove now unused dptr_idlecnum().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 80ae1eba8cb5121172cb3478326e6990d1dc3f4e
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 14:57:17 2019 -0700

    s3: smbd: Remove unused DPTR_IDLE_TIMEOUT.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 609c9a58cebd27c2b3ed2c73a8b9dd1b8880a895
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 14:56:13 2019 -0700

    s3: smbd: Don't idle SMB1 directory scans after DPTR_IDLE_TIMEOUT.
    
    Only broken SMB1 clients leave directory scans hanging
    and we shouldn't support that.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 461001cbc13727b46b0ff3fb8ea347bfc199a9e4
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 14:55:09 2019 -0700

    s3: smbd: Don't idle connections with active SMB1 directory scans.
    
    When all scans are via file handles this code can
    be removed.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit abc58a4a128810294040cca849aad324b9c22fa5
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 8 14:46:20 2019 -0700

    s3: smbd: Add dptr_activecnum(), not yet used.
    
    Will be used to help remove the SMB1 idle directory
    code.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

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

Summary of changes:
 source3/include/local.h  |   8 +-
 source3/smbd/conn_idle.c |  11 ++-
 source3/smbd/dir.c       | 198 +++++++----------------------------------------
 source3/smbd/globals.h   |   1 -
 source3/smbd/proto.h     |   3 +-
 5 files changed, 38 insertions(+), 183 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/local.h b/source3/include/local.h
index 9ae1bcf5347..82c3325008c 100644
--- a/source3/include/local.h
+++ b/source3/include/local.h
@@ -9,12 +9,7 @@
 /* to a maximum of 8 if old smb clients break because of long printer names. */
 #define MAXPRINTERLEN 15
 
-/* max number of directories open at once */
-/* note that with the new directory code this no longer requires a
-   file handle per directory, but large numbers do use more memory */
-#define MAX_OPEN_DIRECTORIES 256
-
-/* max number of directory handles */
+/* max number of SMB1 directory handles */
 /* As this now uses the bitmap code this can be
    quite large. */
 #define MAX_DIRECTORY_HANDLES 2048
@@ -98,7 +93,6 @@
    them unless you know what you are doing. These are all in seconds */
 #define SMBD_RELOAD_CHECK (180)
 #define IDLE_CLOSED_TIMEOUT (60)
-#define DPTR_IDLE_TIMEOUT (120)
 #define SMBD_SELECT_TIMEOUT (60)
 #define NMBD_SELECT_LOOP (10)
 #define BROWSE_INTERVAL (60)
diff --git a/source3/smbd/conn_idle.c b/source3/smbd/conn_idle.c
index 920d808862a..8fa42b2dd63 100644
--- a/source3/smbd/conn_idle.c
+++ b/source3/smbd/conn_idle.c
@@ -59,9 +59,14 @@ bool conn_idle_all(struct smbd_server_connection *sconn, time_t t)
 	for (conn=sconn->connections;conn;conn=conn->next) {
 		time_t age = t - conn->lastused;
 
-		/* close dirptrs on connections that are idle */
-		if (age > DPTR_IDLE_TIMEOUT) {
-			dptr_idlecnum(conn);
+		/*
+		 * Don't idle connections with active
+		 * SMB1 directory scans. When all scans
+		 * are via file handles this code can
+		 * be removed.
+		 */
+		if (dptr_activecnum(sconn, conn)) {
+			return false;
 		}
 
 		if (conn->num_files_open > 0 || age < deadtime) {
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index f05d7a290e5..2c59cb898ec 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -107,84 +107,19 @@ bool init_dptrs(struct smbd_server_connection *sconn)
 	return true;
 }
 
-/****************************************************************************
- Idle a dptr - the directory is closed but the control info is kept.
-****************************************************************************/
-
-static void dptr_idle(struct dptr_struct *dptr)
-{
-	if (dptr->dir_hnd) {
-		DEBUG(4,("Idling dptr dnum %d\n",dptr->dnum));
-		TALLOC_FREE(dptr->dir_hnd);
-		TALLOC_FREE(dptr->dptr_cache);
-		dptr->counter = 0;
-	}
-}
-
-/****************************************************************************
- Idle the oldest dptr.
-****************************************************************************/
-
-static void dptr_idleoldest(struct smbd_server_connection *sconn)
-{
-	struct dptr_struct *dptr;
-
-	/*
-	 * Go to the end of the list.
-	 */
-	dptr = DLIST_TAIL(sconn->searches.dirptrs);
-
-	if(!dptr) {
-		DEBUG(0,("No dptrs available to idle ?\n"));
-		return;
-	}
-
-	/*
-	 * Idle the oldest pointer.
-	 */
-
-	for(; dptr; dptr = DLIST_PREV(dptr)) {
-		if (dptr->dir_hnd) {
-			dptr_idle(dptr);
-			return;
-		}
-	}
-}
-
 /****************************************************************************
  Get the struct dptr_struct for a dir index.
 ****************************************************************************/
 
 static struct dptr_struct *dptr_get(struct smbd_server_connection *sconn,
-				    int key, bool forclose)
+				    int key)
 {
 	struct dptr_struct *dptr;
-	const int dirhandles_open = sconn->searches.dirhandles_open;
 
 	for (dptr = sconn->searches.dirptrs; dptr != NULL; dptr = dptr->next) {
 		if(dptr->dnum != key) {
 			continue;
 		}
-
-		if (!forclose && (dptr->dir_hnd == NULL)) {
-			if (dirhandles_open >= MAX_OPEN_DIRECTORIES) {
-				dptr_idleoldest(sconn);
-			}
-			DBG_INFO("Reopening dptr key %d\n",key);
-
-			dptr->dir_hnd = OpenDir(NULL,
-						dptr->conn,
-						dptr->smb_dname,
-						dptr->wcard,
-						dptr->attr);
-
-			if (dptr->dir_hnd == NULL) {
-				DBG_INFO("Failed to open %s (%s)\n",
-				      dptr->smb_dname->base_name,
-				      strerror(errno));
-				return NULL;
-			}
-		}
 		DLIST_PROMOTE(sconn->searches.dirptrs, dptr);
 		return dptr;
 	}
@@ -197,7 +132,7 @@ static struct dptr_struct *dptr_get(struct smbd_server_connection *sconn,
 
 const char *dptr_path(struct smbd_server_connection *sconn, int key)
 {
-	struct dptr_struct *dptr = dptr_get(sconn, key, false);
+	struct dptr_struct *dptr = dptr_get(sconn, key);
 	if (dptr)
 		return(dptr->smb_dname->base_name);
 	return(NULL);
@@ -209,7 +144,7 @@ const char *dptr_path(struct smbd_server_connection *sconn, int key)
 
 const char *dptr_wcard(struct smbd_server_connection *sconn, int key)
 {
-	struct dptr_struct *dptr = dptr_get(sconn, key, false);
+	struct dptr_struct *dptr = dptr_get(sconn, key);
 	if (dptr)
 		return(dptr->wcard);
 	return(NULL);
@@ -221,7 +156,7 @@ const char *dptr_wcard(struct smbd_server_connection *sconn, int key)
 
 uint16_t dptr_attr(struct smbd_server_connection *sconn, int key)
 {
-	struct dptr_struct *dptr = dptr_get(sconn, key, false);
+	struct dptr_struct *dptr = dptr_get(sconn, key);
 	if (dptr)
 		return(dptr->attr);
 	return(0);
@@ -286,7 +221,7 @@ void dptr_close(struct smbd_server_connection *sconn, int *key)
 		return;
 	}
 
-	dptr = dptr_get(sconn, *key, true);
+	dptr = dptr_get(sconn, *key);
 
 	if (!dptr) {
 		DEBUG(0,("Invalid key %d given to dptr_close\n", *key));
@@ -320,23 +255,20 @@ void dptr_closecnum(connection_struct *conn)
 }
 
 /****************************************************************************
- Idle all dptrs for a cnum.
+ Are there any SMB1 searches active on this connection struct ?
 ****************************************************************************/
 
-void dptr_idlecnum(connection_struct *conn)
+bool dptr_activecnum(const struct smbd_server_connection *sconn,
+			const struct connection_struct *conn)
 {
-	struct dptr_struct *dptr;
-	struct smbd_server_connection *sconn = conn->sconn;
-
-	if (sconn == NULL) {
-		return;
-	}
+	const struct dptr_struct *dptr;
 
 	for(dptr = sconn->searches.dirptrs; dptr; dptr = dptr->next) {
-		if (dptr->conn == conn && dptr->dir_hnd) {
-			dptr_idle(dptr);
+		if (dptr->conn == conn) {
+			return true;
 		}
 	}
+	return false;
 }
 
 /****************************************************************************
@@ -356,43 +288,6 @@ void dptr_closepath(struct smbd_server_connection *sconn,
 	}
 }
 
-/****************************************************************************
- Try and close the oldest handle not marked for
- expect close in the hope that the client has
- finished with that one.
-****************************************************************************/
-
-static void dptr_close_oldest(struct smbd_server_connection *sconn,
-			      bool old)
-{
-	struct dptr_struct *dptr;
-
-	/*
-	 * Go to the end of the list.
-	 */
-	for(dptr = sconn->searches.dirptrs; dptr && dptr->next; dptr = dptr->next)
-		;
-
-	if(!dptr) {
-		DEBUG(0,("No old dptrs available to close oldest ?\n"));
-		return;
-	}
-
-	/*
-	 * If 'old' is true, close the oldest oldhandle dnum (ie. 1 < dnum < 256) that
-	 * does not have expect_close set. If 'old' is false, close
-	 * one of the new dnum handles.
-	 */
-
-	for(; dptr; dptr = DLIST_PREV(dptr)) {
-		if ((old && (dptr->dnum < 256) && !dptr->expect_close) ||
-			(!old && (dptr->dnum > 255))) {
-				dptr_close_internal(dptr);
-				return;
-		}
-	}
-}
-
 /****************************************************************************
  Safely do an OpenDir as root, ensuring we're in the right place.
 ****************************************************************************/
@@ -549,10 +444,6 @@ NTSTATUS dptr_create(connection_struct *conn,
 		return map_nt_error_from_unix(errno);
 	}
 
-	if (sconn->searches.dirhandles_open >= MAX_OPEN_DIRECTORIES) {
-		dptr_idleoldest(sconn);
-	}
-
 	dptr = talloc_zero(NULL, struct dptr_struct);
 	if(!dptr) {
 		DEBUG(0,("talloc fail in dptr_create.\n"));
@@ -599,23 +490,12 @@ NTSTATUS dptr_create(connection_struct *conn,
 		dptr->dnum = bitmap_find(sconn->searches.dptr_bmap, 0);
 
 		if(dptr->dnum == -1 || dptr->dnum > 254) {
-
-			/*
-			 * Try and close the oldest handle not marked for
-			 * expect close in the hope that the client has
-			 * finished with that one.
-			 */
-
-			dptr_close_oldest(sconn, true);
-
-			/* Now try again... */
-			dptr->dnum = bitmap_find(sconn->searches.dptr_bmap, 0);
-			if(dptr->dnum == -1 || dptr->dnum > 254) {
-				DEBUG(0,("dptr_create: returned %d: Error - all old dirptrs in use ?\n", dptr->dnum));
-				TALLOC_FREE(dptr);
-				TALLOC_FREE(dir_hnd);
-				return NT_STATUS_TOO_MANY_OPENED_FILES;
-			}
+			DBG_ERR("returned %d: Error - all old "
+				"dirptrs in use ?\n",
+				dptr->dnum);
+			TALLOC_FREE(dptr);
+			TALLOC_FREE(dir_hnd);
+			return NT_STATUS_TOO_MANY_OPENED_FILES;
 		}
 	} else {
 
@@ -627,25 +507,12 @@ NTSTATUS dptr_create(connection_struct *conn,
 		dptr->dnum = bitmap_find(sconn->searches.dptr_bmap, 255);
 
 		if(dptr->dnum == -1 || dptr->dnum < 255) {
-
-			/*
-			 * Try and close the oldest handle close in the hope that
-			 * the client has finished with that one. This will only
-			 * happen in the case of the Win98 client bug where it leaks
-			 * directory handles.
-			 */
-
-			dptr_close_oldest(sconn, false);
-
-			/* Now try again... */
-			dptr->dnum = bitmap_find(sconn->searches.dptr_bmap, 255);
-
-			if(dptr->dnum == -1 || dptr->dnum < 255) {
-				DEBUG(0,("dptr_create: returned %d: Error - all new dirptrs in use ?\n", dptr->dnum));
-				TALLOC_FREE(dptr);
-				TALLOC_FREE(dir_hnd);
-				return NT_STATUS_TOO_MANY_OPENED_FILES;
-			}
+			DBG_ERR("returned %d: Error - all new "
+				"dirptrs in use ?\n",
+				dptr->dnum);
+			TALLOC_FREE(dptr);
+			TALLOC_FREE(dir_hnd);
+			return NT_STATUS_TOO_MANY_OPENED_FILES;
 		}
 	}
 
@@ -969,7 +836,7 @@ bool dptr_fill(struct smbd_server_connection *sconn,
 	       char *buf1,unsigned int key)
 {
 	unsigned char *buf = (unsigned char *)buf1;
-	struct dptr_struct *dptr = dptr_get(sconn, key, false);
+	struct dptr_struct *dptr = dptr_get(sconn, key);
 	uint32_t wire_offset;
 	if (!dptr) {
 		DEBUG(1,("filling null dirptr %d\n",key));
@@ -1033,7 +900,7 @@ struct dptr_struct *dptr_fetch(struct smbd_server_connection *sconn,
 			       char *buf, int *num)
 {
 	unsigned int key = *(unsigned char *)buf;
-	struct dptr_struct *dptr = dptr_get(sconn, key, false);
+	struct dptr_struct *dptr = dptr_get(sconn, key);
 	uint32_t wire_offset;
 	long seekoff;
 
@@ -1057,7 +924,7 @@ struct dptr_struct *dptr_fetch(struct smbd_server_connection *sconn,
 struct dptr_struct *dptr_fetch_lanman2(struct smbd_server_connection *sconn,
 				       int dptr_num)
 {
-	struct dptr_struct *dptr  = dptr_get(sconn, dptr_num, false);
+	struct dptr_struct *dptr  = dptr_get(sconn, dptr_num);
 
 	if (!dptr) {
 		DEBUG(3,("fetched null dirptr %d\n",dptr_num));
@@ -1646,9 +1513,6 @@ static int smb_Dir_destructor(struct smb_Dir *dirp)
 			dirp->fsp = NULL;
 		}
 	}
-	if (dirp->conn->sconn && !dirp->conn->sconn->using_smb2) {
-		dirp->conn->sconn->searches.dirhandles_open--;
-	}
 	return 0;
 }
 
@@ -1663,7 +1527,6 @@ static struct smb_Dir *OpenDir_internal(TALLOC_CTX *mem_ctx,
 			uint32_t attr)
 {
 	struct smb_Dir *dirp = talloc_zero(mem_ctx, struct smb_Dir);
-	struct smbd_server_connection *sconn = conn->sconn;
 
 	if (!dirp) {
 		return NULL;
@@ -1690,9 +1553,6 @@ static struct smb_Dir *OpenDir_internal(TALLOC_CTX *mem_ctx,
 		dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn));
 	}
 
-	if (sconn && !sconn->using_smb2) {
-		sconn->searches.dirhandles_open++;
-	}
 	talloc_set_destructor(dirp, smb_Dir_destructor);
 
 	return dirp;
@@ -1793,7 +1653,6 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
 			uint32_t attr)
 {
 	struct smb_Dir *dirp = talloc_zero(mem_ctx, struct smb_Dir);
-	struct smbd_server_connection *sconn = conn->sconn;
 
 	if (!dirp) {
 		goto fail;
@@ -1850,9 +1709,6 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
 					attr);
 	}
 
-	if (sconn && !sconn->using_smb2) {
-		sconn->searches.dirhandles_open++;
-	}
 	talloc_set_destructor(dirp, smb_Dir_destructor);
 
 	return dirp;
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 03d50882d16..bdd8c49e2ba 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -879,7 +879,6 @@ struct smbd_server_connection {
 	struct {
 		struct bitmap *dptr_bmap;
 		struct dptr_struct *dirptrs;
-		int dirhandles_open;
 	} searches;
 
 	uint64_t num_requests;
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index 37eeb9f31ca..4a47d394686 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -185,7 +185,8 @@ const char *dptr_wcard(struct smbd_server_connection *sconn, int key);
 uint16_t dptr_attr(struct smbd_server_connection *sconn, int key);
 void dptr_close(struct smbd_server_connection *sconn, int *key);
 void dptr_closecnum(connection_struct *conn);
-void dptr_idlecnum(connection_struct *conn);
+bool dptr_activecnum(const struct smbd_server_connection *sconn,
+			const struct connection_struct *conn);
 void dptr_closepath(struct smbd_server_connection *sconn,
 		    char *path,uint16_t spid);
 NTSTATUS dptr_create(connection_struct *conn,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list