]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Use common function setup_readX_header() in aio read code.
authorJeremy Allison <jra@samba.org>
Mon, 13 Jun 2016 16:25:02 +0000 (09:25 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 22 Jun 2016 11:11:13 +0000 (13:11 +0200)
https://bugzilla.samba.org/show_bug.cgi?id=11845

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 6507336d6646b7709768c19a03eac61ea30cce31)

source3/smbd/aio.c

index 253782bba2d50cc13e060db94b8dc61336219f92..e43dc710854a632c13c49117587f2bc811f8344e 100644 (file)
@@ -258,7 +258,6 @@ static void aio_pread_smb1_done(struct tevent_req *req)
        files_struct *fsp = aio_ex->fsp;
        int outsize;
        char *outbuf = (char *)aio_ex->outbuf.data;
-       char *data = smb_buf(outbuf) + 1 /* padding byte */;
        ssize_t nread;
        int err;
 
@@ -287,13 +286,7 @@ static void aio_pread_smb1_done(struct tevent_req *req)
                ERROR_NT(map_nt_error_from_unix(err));
                outsize = srv_set_message(outbuf,0,0,true);
        } else {
-               outsize = srv_set_message(outbuf, 12,
-                                         nread + 1 /* padding byte */, false);
-               SSVAL(outbuf,smb_vwv2, 0xFFFF); /* Remaining - must be * -1. */
-               SSVAL(outbuf,smb_vwv5, nread);
-               SSVAL(outbuf,smb_vwv6, smb_offset(data,outbuf));
-               SSVAL(outbuf,smb_vwv7, ((nread >> 16) & 1));
-               SSVAL(smb_buf(outbuf), -2, nread);
+               outsize = setup_readX_header(outbuf, nread);
 
                aio_ex->fsp->fh->pos = aio_ex->offset + nread;
                aio_ex->fsp->fh->position_information = aio_ex->fsp->fh->pos;