make the SEC_STD_SYNCHRONIZE test more specific
[kai/samba.git] / source4 / ntvfs / posix / pvfs_open.c
index 739c127b985bb0077e2627e3c32f1f264faa1873..cfa88b6baad40e8dbb511fa7a343f7cd4bf2efc4 100644 (file)
@@ -1155,13 +1155,16 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
                return NT_STATUS_ACCESS_DENIED;
        }
 
+       /* what does this bit really mean?? */
        if (req->ctx->protocol == PROTOCOL_SMB2 &&
-           (access_mask & SEC_STD_SYNCHRONIZE)) {
+           (access_mask & SEC_STD_SYNCHRONIZE) &&
+           !(access_mask & SEC_STD_READ_CONTROL)) {
                return NT_STATUS_ACCESS_DENIED;
        }
 
        if (io->ntcreatex.in.file_attr & (FILE_ATTRIBUTE_DEVICE|
-                                         FILE_ATTRIBUTE_VOLUME)) {
+                                         FILE_ATTRIBUTE_VOLUME| 
+                                         (~FILE_ATTRIBUTE_ALL_MASK))) {
                return NT_STATUS_INVALID_PARAMETER;
        }