From 2e4c8c01591496b5fb44f0d7e2ce082a9795c2f3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 20 Oct 2004 11:10:51 +0000 Subject: r3083: fixed a couple of generic mapping errors found with RAW-* and cifs:mapgeneric (This used to be commit 76329798ff7f804bf4d7e6e9c1bb4c4dc7b9bb01) --- source4/ntvfs/ntvfs_generic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4') 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; -- cgit