summaryrefslogtreecommitdiff
path: root/source4/ntvfs/ntvfs_generic.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-20 11:10:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:01:57 -0500
commit2e4c8c01591496b5fb44f0d7e2ce082a9795c2f3 (patch)
treef928faeb5aedee6899ac065ef24d24744b17fa87 /source4/ntvfs/ntvfs_generic.c
parent4b14c8a09f009e2fae6af601fb3effd200c06196 (diff)
downloadsamba-2e4c8c01591496b5fb44f0d7e2ce082a9795c2f3.tar.gz
samba-2e4c8c01591496b5fb44f0d7e2ce082a9795c2f3.tar.bz2
samba-2e4c8c01591496b5fb44f0d7e2ce082a9795c2f3.zip
r3083: fixed a couple of generic mapping errors found with RAW-* and cifs:mapgeneric
(This used to be commit 76329798ff7f804bf4d7e6e9c1bb4c4dc7b9bb01)
Diffstat (limited to 'source4/ntvfs/ntvfs_generic.c')
-rw-r--r--source4/ntvfs/ntvfs_generic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c
index b6f3d8e603..d4c163844f 100644
--- a/source4/ntvfs/ntvfs_generic.c
+++ b/source4/ntvfs/ntvfs_generic.c
@@ -773,7 +773,8 @@ NTSTATUS ntvfs_map_write(struct smbsrv_request *req, union smb_write *wr,
wr->writeunlock.out.nwritten = wr2->generic.out.nwritten;
- if (NT_STATUS_IS_OK(status)) {
+ if (NT_STATUS_IS_OK(status) &&
+ lck->unlock.in.count != 0) {
status = ntvfs->ops->lock(ntvfs, req, lck);
}
break;
@@ -798,7 +799,8 @@ NTSTATUS ntvfs_map_write(struct smbsrv_request *req, union smb_write *wr,
status = ntvfs->ops->write(ntvfs, req, wr2);
wr->writeclose.out.nwritten = wr2->generic.out.nwritten;
- if (NT_STATUS_IS_OK(status)) {
+ if (NT_STATUS_IS_OK(status) &&
+ wr2->generic.in.count != 0) {
status = ntvfs->ops->close(ntvfs, req, cl);
}
break;