s3:libsmb: consistently use state->size in cli_write_andx_create() (bug #5326)
authorStefan Metzmacher <metze@samba.org>
Fri, 11 Nov 2011 01:10:00 +0000 (02:10 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 16 Nov 2011 19:34:05 +0000 (20:34 +0100)
Otherwise we may get unexpected results.

This is a fix that was missing in commit 95595dd93fd04999fcf56ecaab7c29b064d021f8
(s3:libsmb: fix cli_write_and_x() against OS/2 print shares (bug #5326))

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Nov  9 10:13:32 CET 2011 on sn-devel-104
(cherry picked from commit 4b31c4273c45faa639445614061f3da548eb8505)

source3/libsmb/clireadwrite.c

index 5a70f6500328f1782c9cd6c47e119c6d38e43114..215e1d36a66896af9aa6003000513f6bb9f2e27b 100644 (file)
@@ -837,7 +837,7 @@ struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx,
        state->iov[0].iov_base = (void *)&state->pad;
        state->iov[0].iov_len = 1;
        state->iov[1].iov_base = CONST_DISCARD(void *, buf);
-       state->iov[1].iov_len = size;
+       state->iov[1].iov_len = state->size;
 
        subreq = cli_smb_req_create(state, ev, cli, SMBwriteX, 0, wct, vwv,
                                    2, state->iov);