summaryrefslogtreecommitdiff
path: root/source4/ntvfs/ntvfs_generic.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-26 12:19:09 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-26 12:19:09 +0200
commit40a90e6a5581f74b2e8caf67d934a08e8a9befc9 (patch)
treea34823fd0dec12eb87976e20e4dbdb3f3e4e1069 /source4/ntvfs/ntvfs_generic.c
parent58b1ab92a117cfcb311bdcb41fe563077ad39500 (diff)
parent98e72f574a9ce2a676bcb010e4e6ee2df39af4b6 (diff)
downloadsamba-40a90e6a5581f74b2e8caf67d934a08e8a9befc9.tar.gz
samba-40a90e6a5581f74b2e8caf67d934a08e8a9befc9.tar.bz2
samba-40a90e6a5581f74b2e8caf67d934a08e8a9befc9.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-pyirpc
(This used to be commit e1af9708c9b40edfa21862028672882797218174)
Diffstat (limited to 'source4/ntvfs/ntvfs_generic.c')
-rw-r--r--source4/ntvfs/ntvfs_generic.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c
index 62a1427405..9b4f235cde 100644
--- a/source4/ntvfs/ntvfs_generic.c
+++ b/source4/ntvfs/ntvfs_generic.c
@@ -522,6 +522,12 @@ NTSTATUS ntvfs_map_open(struct ntvfs_module_context *ntvfs,
io2->generic.in.fname = io->smb2.in.fname;
io2->generic.in.sec_desc = NULL;
io2->generic.in.ea_list = NULL;
+
+ /* we use a couple of bits of the create options internally */
+ if (io2->generic.in.create_options & NTCREATEX_OPTIONS_PRIVATE_MASK) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
status = ntvfs->ops->open(ntvfs, req, io2);
break;
@@ -1031,6 +1037,9 @@ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs,
return NT_STATUS_NO_MEMORY;
}
for (i=0;i<lck->smb2.in.lock_count;i++) {
+ if (lck->smb2.in.locks[i].flags & ~SMB2_LOCK_FLAG_ALL_MASK) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
if (lck->smb2.in.locks[i].flags & SMB2_LOCK_FLAG_UNLOCK) {
int j = lck2->generic.in.ulock_cnt;
lck2->generic.in.ulock_cnt++;
@@ -1277,10 +1286,15 @@ static NTSTATUS ntvfs_map_read_finish(struct ntvfs_module_context *ntvfs,
rd->smb2.out.remaining = 0;
rd->smb2.out.reserved = 0;
if (NT_STATUS_IS_OK(status) &&
- rd->smb2.out.data.length == 0 &&
- rd->smb2.in.length != 0) {
+ rd->smb2.out.data.length == 0) {
status = NT_STATUS_END_OF_FILE;
}
+ /* SMB2 does honor the min_count field, SMB does not */
+ if (NT_STATUS_IS_OK(status) &&
+ rd->smb2.in.min_count > rd->smb2.out.data.length) {
+ rd->smb2.out.data.length = 0;
+ status = NT_STATUS_END_OF_FILE;
+ }
break;
default:
return NT_STATUS_INVALID_LEVEL;