summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_read.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/ntvfs/posix/pvfs_read.c')
-rw-r--r--source4/ntvfs/posix/pvfs_read.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/ntvfs/posix/pvfs_read.c b/source4/ntvfs/posix/pvfs_read.c
index 734134368d..1f89f01a03 100644
--- a/source4/ntvfs/posix/pvfs_read.c
+++ b/source4/ntvfs/posix/pvfs_read.c
@@ -34,6 +34,7 @@ NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs,
struct pvfs_file *f;
NTSTATUS status;
uint32_t maxcnt;
+ uint32_t mask;
if (rd->generic.level != RAW_READ_READX) {
return ntvfs_map_read(req, rd, ntvfs);
@@ -48,8 +49,12 @@ NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs,
return NT_STATUS_FILE_IS_A_DIRECTORY;
}
- if (!(f->access_mask & SA_RIGHT_FILE_READ_EXEC)) {
- return NT_STATUS_ACCESS_VIOLATION;
+ mask = SA_RIGHT_FILE_READ_DATA;
+ if (req->flags2 & FLAGS2_READ_PERMIT_EXECUTE) {
+ mask |= SA_RIGHT_FILE_EXECUTE;
+ }
+ if (!(f->access_mask & mask)) {
+ return NT_STATUS_ACCESS_DENIED;
}
maxcnt = rd->readx.in.maxcnt;