diff options
-rw-r--r-- | source4/ntvfs/ntvfs_generic.c | 6 |
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; |