summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-04-17 13:05:25 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-04-17 13:05:25 +0200
commitdd0da89e841e5df0c1fe27122df0c1644278c65e (patch)
tree75de1500ca458d977c36831491a9495738da9c2c /source4/ntvfs
parent0197b8e0ff8dc26eeb71dccf61d8937c63bacff5 (diff)
parent4d8f3f190215edcdbeb1725cccdc962dc68cc1a0 (diff)
downloadsamba-dd0da89e841e5df0c1fe27122df0c1644278c65e.tar.gz
samba-dd0da89e841e5df0c1fe27122df0c1644278c65e.tar.bz2
samba-dd0da89e841e5df0c1fe27122df0c1644278c65e.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit ece878c1f9251b83598508e23ce0015b4db72f0a)
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/ntvfs_generic.c29
-rw-r--r--source4/ntvfs/posix/pvfs_acl.c2
2 files changed, 28 insertions, 3 deletions
diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c
index fee3269eaf..5d4bbf388c 100644
--- a/source4/ntvfs/ntvfs_generic.c
+++ b/source4/ntvfs/ntvfs_generic.c
@@ -208,7 +208,21 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs,
case RAW_OPEN_SMB2:
io->smb2.out.file.ntvfs = io2->generic.out.file.ntvfs;
- io->smb2.out.oplock_level = 0;
+ switch (io2->generic.out.oplock_level) {
+ case OPLOCK_BATCH:
+ io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_BATCH;
+ break;
+ case OPLOCK_EXCLUSIVE:
+ io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_EXCLUSIVE;
+ break;
+ case OPLOCK_LEVEL_II:
+ io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_II;
+ break;
+ default:
+ io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_NONE;
+ break;
+ }
+ io->smb2.out.reserved = 0;
io->smb2.out.create_action = io2->generic.out.create_action;
io->smb2.out.create_time = io2->generic.out.create_time;
io->smb2.out.access_time = io2->generic.out.access_time;
@@ -484,7 +498,18 @@ NTSTATUS ntvfs_map_open(struct ntvfs_module_context *ntvfs,
status = ntvfs->ops->open(ntvfs, req, io2);
break;
case RAW_OPEN_SMB2:
- io2->generic.in.flags = 0;
+ switch (io->smb2.in.oplock_level) {
+ case SMB2_OPLOCK_LEVEL_BATCH:
+ io2->generic.in.flags = NTCREATEX_FLAGS_REQUEST_BATCH_OPLOCK |
+ NTCREATEX_FLAGS_REQUEST_OPLOCK;
+ break;
+ case SMB2_OPLOCK_LEVEL_EXCLUSIVE:
+ io2->generic.in.flags = NTCREATEX_FLAGS_REQUEST_OPLOCK;
+ break;
+ default:
+ io2->generic.in.flags = 0;
+ break;
+ }
io2->generic.in.root_fid = 0;
io2->generic.in.access_mask = io->smb2.in.desired_access;
io2->generic.in.alloc_size = 0;
diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c
index 2393a2e7a3..f1e469f790 100644
--- a/source4/ntvfs/posix/pvfs_acl.c
+++ b/source4/ntvfs/posix/pvfs_acl.c
@@ -135,7 +135,7 @@ static NTSTATUS pvfs_default_acl(struct pvfs_state *pvfs,
}
sd = *psd;
- ids = talloc_array(sd, struct id_mapping, 2);
+ ids = talloc_zero_array(sd, struct id_mapping, 2);
NT_STATUS_HAVE_NO_MEMORY(ids);
ids[0].unixid = talloc(ids, struct unixid);