From 0237d06ccd2a391f91bb4ddc27dac8b46492b107 Mon Sep 17 00:00:00 2001 From: Kyrylo Shpytsya Date: Thu, 7 Apr 2011 14:41:34 +0300 Subject: [PATCH] Properly update file position on read when "use sendfile=yes". --- source3/smbd/reply.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 5697594..24a7c84 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -3626,6 +3626,9 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req, DEBUG( 3, ( "send_file_readX: sendfile fnum=%d max=%d nread=%d\n", fsp->fnum, (int)smb_maxcnt, (int)nread ) ); + fsp->fh->pos = startpos + nread - sizeof(headerbuf); + fsp->fh->position_information = fsp->fh->pos; + /* Deal with possible short send. */ if (nread != smb_maxcnt + sizeof(headerbuf)) { sendfile_short_send(fsp, nread, sizeof(headerbuf), smb_maxcnt); -- 1.7.4.1