git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
808721f
)
Check for error in transfer_file return also.
author
Jeremy Allison
<jra@samba.org>
Fri, 12 Jun 2009 20:55:18 +0000
(13:55 -0700)
committer
Jeremy Allison
<jra@samba.org>
Fri, 12 Jun 2009 20:55:18 +0000
(13:55 -0700)
Jeremy.
source3/smbd/close.c
patch
|
blob
|
history
diff --git
a/source3/smbd/close.c
b/source3/smbd/close.c
index bc54bacbc8e2ee6ae072fc9cbcc8aaf8b04255a9..760a2d520ccd543a2211af2643bb16595a792db9 100644
(file)
--- a/
source3/smbd/close.c
+++ b/
source3/smbd/close.c
@@
-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);