diff options
-rw-r--r-- | source3/smbd/dir.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 1d90a77b57..a7dc537074 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -261,6 +261,10 @@ static void dptr_close_internal(struct dptr_struct *dptr) goto done; } + if (sconn->using_smb2) { + goto done; + } + DLIST_REMOVE(sconn->searches.dirptrs, dptr); /* @@ -524,6 +528,10 @@ NTSTATUS dptr_create(connection_struct *conn, files_struct *fsp, dptr->attr = attr; + if (sconn->using_smb2) { + goto done; + } + if(old_handle) { /* @@ -594,6 +602,7 @@ NTSTATUS dptr_create(connection_struct *conn, files_struct *fsp, DLIST_ADD(sconn->searches.dirptrs, dptr); +done: DEBUG(3,("creating new dirptr %d for path %s, expect_close = %d\n", dptr->dnum,path,expect_close)); @@ -1367,7 +1376,7 @@ static int smb_Dir_destructor(struct smb_Dir *dirp) #endif SMB_VFS_CLOSEDIR(dirp->conn,dirp->dir); } - if (dirp->conn->sconn) { + if (dirp->conn->sconn && !dirp->conn->sconn->using_smb2) { dirp->conn->sconn->searches.dirhandles_open--; } return 0; @@ -1398,7 +1407,7 @@ struct smb_Dir *OpenDir(TALLOC_CTX *mem_ctx, connection_struct *conn, goto fail; } - if (sconn) { + if (sconn && !sconn->using_smb2) { sconn->searches.dirhandles_open++; } talloc_set_destructor(dirp, smb_Dir_destructor); @@ -1442,7 +1451,7 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn, goto fail; } - if (sconn) { + if (sconn && !sconn->using_smb2) { sconn->searches.dirhandles_open++; } talloc_set_destructor(dirp, smb_Dir_destructor); |