mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +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:
parent
a6eee38ba2
commit
ba68f21286
@ -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);
|
||||
|
@ -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)) &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user