From a8676e69a636648d8a309e8e000dcd62d38bfa06 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 12 Sep 2012 11:21:01 -0700 Subject: Remove ancient "optimization" global LastDir. --- source3/smbd/globals.c | 1 - source3/smbd/globals.h | 1 - source3/smbd/vfs.c | 19 +++---------------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c index 80f6a664277..874f35d1f6f 100644 --- a/source3/smbd/globals.c +++ b/source3/smbd/globals.c @@ -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; diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index 566f04d71f3..1cefe51faa7 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -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; diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 763ef37f899..3eda2cf97be 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -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); } /******************************************************************* -- cgit v1.2.1