summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/dir.c6
-rw-r--r--source3/smbd/smb2_find.c5
2 files changed, 6 insertions, 5 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 8af0dad8c3..a11c131b49 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -444,6 +444,12 @@ NTSTATUS dptr_create(connection_struct *conn, files_struct *fsp,
}
if (fsp) {
+ if (!(fsp->access_mask & SEC_DIR_LIST)) {
+ DEBUG(5,("dptr_create: directory %s "
+ "not open for LIST access\n",
+ path));
+ return NT_STATUS_ACCESS_DENIED;
+ }
dir_hnd = OpenDir_fsp(NULL, conn, fsp, wcard, attr);
} else {
dir_hnd = OpenDir(NULL, conn, path, wcard, attr);
diff --git a/source3/smbd/smb2_find.c b/source3/smbd/smb2_find.c
index e64db24d02..6369e7fdbe 100644
--- a/source3/smbd/smb2_find.c
+++ b/source3/smbd/smb2_find.c
@@ -323,11 +323,6 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
if (fsp->dptr == NULL) {
bool wcard_has_wild;
- if (!(fsp->access_mask & SEC_DIR_LIST)) {
- tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED);
- return tevent_req_post(req, ev);
- }
-
wcard_has_wild = ms_has_wild(in_file_name);
status = dptr_create(conn,