bug in send_file_readbraw?

Alison Winters alisonw at sgi.com
Wed May 9 00:44:33 GMT 2007


I've been poking around in reply.c the past few days working on some
profiling improvements, and i noticed something that appears to be a bug
in the send_file_readbraw function.  I could be wrong in identifying
this as a bug because i don't know what Windows does in this case, but
it seems a bit bizarre to me that if the sendfile() call succeeds, we
then continue to call read_file() and write_data() immediately
afterwards.  It looks to me like we'll be sending duplicate data in this
case.  Patch against SAMBA_3_0 is attached, though this is evident in
3.0.24 and presumably other versions too.

Alison
-------------- next part --------------
Index: source/smbd/reply.c
===================================================================
--- source/smbd/reply.c	(revision 22764)
+++ source/smbd/reply.c	(working copy)
@@ -2237,7 +2237,7 @@
 				fsp->fsp_name, strerror(errno) ));
 			exit_server_cleanly("send_file_readbraw sendfile failed");
 		}
-
+		return;
 	}
 
   normal_readbraw:


More information about the samba-technical mailing list