check for some more invalid bits in smb2 create
authorAndrew Tridgell <tridge@samba.org>
Tue, 27 May 2008 04:07:11 +0000 (14:07 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 27 May 2008 04:07:11 +0000 (14:07 +1000)
(This used to be commit dcdaa9f5fd9150b16fb277213e864e5c39d831d6)

source4/ntvfs/posix/pvfs_open.c

index 59b42fe751cf2ce6e628d295f9df829bbf23d3ee..328f064a573a0cde1bcc51b57f6c701ebda5f615 100644 (file)
@@ -1147,6 +1147,15 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
                return NT_STATUS_INVALID_PARAMETER;
        }
 
+       if (access_mask & (SEC_MASK_INVALID | SEC_STD_SYNCHRONIZE)) {
+               return NT_STATUS_ACCESS_DENIED;
+       }
+
+       if (io->ntcreatex.in.file_attr & (FILE_ATTRIBUTE_DEVICE|
+                                         FILE_ATTRIBUTE_VOLUME)) {
+               return NT_STATUS_INVALID_PARAMETER;
+       }
+
        /* resolve the cifs name to a posix name */
        status = pvfs_resolve_name(pvfs, req, io->ntcreatex.in.fname, 
                                   PVFS_RESOLVE_STREAMS, &name);