mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
Ensure we don't prematurely clean out the bytes read.
Jeremy.
(This used to be commit 247675695d
)
This commit is contained in:
parent
c3250149e1
commit
360c02328f
@ -428,12 +428,15 @@ ssize_t vfs_write_data(struct smb_request *req,
|
||||
|
||||
if (req && req->unread_bytes) {
|
||||
SMB_ASSERT(req->unread_bytes == N);
|
||||
req->unread_bytes = 0;
|
||||
return SMB_VFS_RECVFILE(smbd_server_fd(),
|
||||
ret = SMB_VFS_RECVFILE(smbd_server_fd(),
|
||||
fsp,
|
||||
fsp->fh->fd,
|
||||
(SMB_OFF_T)-1,
|
||||
N);
|
||||
if (ret != -1) {
|
||||
req->unread_bytes = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
while (total < N) {
|
||||
@ -460,12 +463,15 @@ ssize_t vfs_pwrite_data(struct smb_request *req,
|
||||
|
||||
if (req && req->unread_bytes) {
|
||||
SMB_ASSERT(req->unread_bytes == N);
|
||||
req->unread_bytes = 0;
|
||||
return SMB_VFS_RECVFILE(smbd_server_fd(),
|
||||
ret = SMB_VFS_RECVFILE(smbd_server_fd(),
|
||||
fsp,
|
||||
fsp->fh->fd,
|
||||
offset,
|
||||
N);
|
||||
if (ret != -1) {
|
||||
req->unread_bytes = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
while (total < N) {
|
||||
|
Loading…
Reference in New Issue
Block a user