From: Jeremy Allison Date: Mon, 8 Jul 2019 22:34:41 +0000 (-0700) Subject: s3: smbd: Remove SMB1 idle unused directory handles code. X-Git-Tag: talloc-2.3.0~139 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b6129d14e4d22728c009ec72529f6f18010db68;p=thirdparty%2Fsamba.git 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 Reviewed-by: Andreas Schneider --- diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 421de0af5a7..b53f0dc6c2e 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -107,6 +107,7 @@ bool init_dptrs(struct smbd_server_connection *sconn) return true; } +#if 0 /**************************************************************************** Idle a dptr - the directory is closed but the control info is kept. ****************************************************************************/ @@ -150,6 +151,7 @@ static void dptr_idleoldest(struct smbd_server_connection *sconn) } } } +#endif /**************************************************************************** Get the struct dptr_struct for a dir index. @@ -159,32 +161,11 @@ static struct dptr_struct *dptr_get(struct smbd_server_connection *sconn, int key, bool forclose) { 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; }