1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

Check for error in transfer_file return also.

Jeremy.
This commit is contained in:
Jeremy Allison 2009-06-12 13:55:18 -07:00
parent 808721f7bb
commit f409b00dc7

View File

@ -106,7 +106,13 @@ static NTSTATUS check_magic(struct files_struct *fsp)
return map_nt_error_from_unix(err);
}
transfer_file(tmp_fd,outfd,(SMB_OFF_T)st.st_ex_size);
if (transfer_file(tmp_fd,outfd,(SMB_OFF_T)st.st_ex_size) == (SMB_OFF_T)-1) {
int err = errno;
close(tmp_fd);
close(outfd);
TALLOC_FREE(ctx);
return map_nt_error_from_unix(err);
}
close(tmp_fd);
if (close(outfd) == -1) {
TALLOC_FREE(ctx);