1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

Move the SEC_DIR_LIST check into dptr_create for SMB2 and now for SMB1.

The pathname check still needs fixing.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Nov  5 01:38:00 CET 2011 on sn-devel-104
This commit is contained in:
Jeremy Allison 2011-11-04 10:51:29 -07:00
parent 7ff5a5584f
commit 2898485848
2 changed files with 6 additions and 5 deletions

View File

@ -444,6 +444,12 @@ NTSTATUS dptr_create(connection_struct *conn, files_struct *fsp,
} }
if (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); dir_hnd = OpenDir_fsp(NULL, conn, fsp, wcard, attr);
} else { } else {
dir_hnd = OpenDir(NULL, conn, path, wcard, attr); dir_hnd = OpenDir(NULL, conn, path, wcard, attr);

View File

@ -323,11 +323,6 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
if (fsp->dptr == NULL) { if (fsp->dptr == NULL) {
bool wcard_has_wild; 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); wcard_has_wild = ms_has_wild(in_file_name);
status = dptr_create(conn, status = dptr_create(conn,