s3: smbd: Remove SMB1 idle unused directory handles code.
authorJeremy Allison <jra@samba.org>
Mon, 8 Jul 2019 22:34:41 +0000 (15:34 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 9 Jul 2019 23:12:16 +0000 (23:12 +0000)
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@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/smbd/dir.c

index 421de0af5a70598ee28cbc736f61c1f8fbae1dc3..b53f0dc6c2e59b787e9f99cc29c143eae0704f28 100644 (file)
@@ -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;
        }