Writes with a length of 0 are allowed.
The readfile related check we had before was not really useful
as min_dyn_len can only every be 0 or 1 (and for SMB2_OP_WRITE it's
always 1). So we checked
if (unread_bytes > 0) {
if (unread_bytes < 1) {
return 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>
switch (opcode) {
case SMB2_OP_IOCTL:
case SMB2_OP_GETINFO:
- min_dyn_size = 0;
- break;
case SMB2_OP_WRITE:
- if (req->smb1req != NULL && req->smb1req->unread_bytes > 0) {
- if (req->smb1req->unread_bytes < min_dyn_size) {
- return NT_STATUS_INVALID_PARAMETER;
- }
-
- min_dyn_size = 0;
- }
+ min_dyn_size = 0;
break;
}