summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-09-14 00:34:46 +0000
committerJeremy Allison <jra@samba.org>2002-09-14 00:34:46 +0000
commitfebd3f929b0f922a4bac69aa131089da4675cb1e (patch)
treeef55a75fde1e2317df914782898d056342b60d02 /source3/smbd
parent10297d8cd3bfdef44ea6fdf4d0520fe6c613108c (diff)
downloadsamba-febd3f929b0f922a4bac69aa131089da4675cb1e.tar.gz
samba-febd3f929b0f922a4bac69aa131089da4675cb1e.tar.bz2
samba-febd3f929b0f922a4bac69aa131089da4675cb1e.zip
Added fix for broken Linux (no sendfile64). When offset + count > 2GB
then return ENOSYS and let the upper layer handle it. Jeremy (This used to be commit 872dfd87cda585c33c3823b06580cb301567a9b9)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/reply.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 02aa53807c..878e21f4c2 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1730,6 +1730,13 @@ int send_file_readX(connection_struct *conn, char *inbuf,char *outbuf,int length
header.free = NULL;
if ( conn->vfs_ops.sendfile( smbd_server_fd(), fsp, fsp->fd, &header, startpos, smb_maxcnt) == -1) {
+ /*
+ * Special hack for broken Linux with no 64 bit clean sendfile. If we
+ * return ENOSYS then pretend we just got a normal read.
+ */
+ if (errno == ENOSYS)
+ goto normal_read;
+
DEBUG(0,("send_file_readX: sendfile failed for file %s (%s). Terminating\n",
fsp->fsp_name, strerror(errno) ));
exit_server("send_file_readX sendfile failed");