1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-25 17:57:42 +03:00

s3:smbd: handle 0 length writes as no-op.

They should never touch the SMB_VFS layer
and they never trigger an DISK_FULL error.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14361

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Stefan Metzmacher 2020-05-11 18:18:24 +02:00 committed by Jeremy Allison
parent a6eee38ba2
commit ba68f21286
2 changed files with 9 additions and 0 deletions

View File

@ -337,6 +337,11 @@ static struct tevent_req *pwrite_fsync_send(TALLOC_CTX *mem_ctx,
state->fsp = fsp;
state->write_through = write_through;
if (n == 0) {
tevent_req_done(req);
return tevent_req_post(req, ev);
}
subreq = SMB_VFS_PWRITE_SEND(state, ev, fsp, data, n, offset);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);

View File

@ -70,6 +70,10 @@ static ssize_t real_write_file(struct smb_request *req,
{
ssize_t ret;
if (n == 0) {
return 0;
}
fsp->fh->pos = pos;
if (pos &&
lp_strict_allocate(SNUM(fsp->conn)) &&