Remove ancient "optimization" global LastDir.
authorJeremy Allison <jra@samba.org>
Wed, 12 Sep 2012 18:21:01 +0000 (11:21 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 12 Sep 2012 20:06:06 +0000 (22:06 +0200)
source3/smbd/globals.c
source3/smbd/globals.h
source3/smbd/vfs.c

index 80f6a6642773f50c22c7bee14288defaaada68d0..874f35d1f6f180e11f9085abf3e1571099e7e2a4 100644 (file)
@@ -85,7 +85,6 @@ int conn_ctx_stack_ndx = 0;
 
 struct vfs_init_function_entry *backends = NULL;
 char *sparse_buf = NULL;
-char *LastDir = NULL;
 
 struct smbd_parent_context *am_parent = NULL;
 struct memcache *smbd_memcache_ctx = NULL;
index 566f04d71f3fe754c72110807ef7e8f552bcf464..1cefe51faa7e1a3b39b98ba0688305f762a31668 100644 (file)
@@ -101,7 +101,6 @@ extern int conn_ctx_stack_ndx;
 struct vfs_init_function_entry;
 extern struct vfs_init_function_entry *backends;
 extern char *sparse_buf;
-extern char *LastDir;
 
 struct smbd_parent_context;
 extern struct smbd_parent_context *am_parent;
index 763ef37f899984732339669965f2457c074a739c..3eda2cf97be96ceb2bc414485e28d5e7ba1cee36 100644 (file)
@@ -799,26 +799,13 @@ const char *vfs_readdirname(connection_struct *conn, void *p,
 
 int vfs_ChDir(connection_struct *conn, const char *path)
 {
-       int res;
-
-       if (!LastDir) {
-               LastDir = SMB_STRDUP("");
+       if (strcsequal(path,".")) {
+               return 0;
        }
 
-       if (strcsequal(path,"."))
-               return(0);
-
-       if (*path == '/' && strcsequal(LastDir,path))
-               return(0);
-
        DEBUG(4,("vfs_ChDir to %s\n",path));
 
-       res = SMB_VFS_CHDIR(conn,path);
-       if (!res) {
-               SAFE_FREE(LastDir);
-               LastDir = SMB_STRDUP(path);
-       }
-       return(res);
+       return SMB_VFS_CHDIR(conn,path);
 }
 
 /*******************************************************************