Pass "bytes_alignment" up through cli_request_send
authorVolker Lendecke <vl@samba.org>
Fri, 19 Dec 2008 13:27:20 +0000 (14:27 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 19 Dec 2008 13:53:29 +0000 (14:53 +0100)
This parameter makes smb_spice_chain add padding before the bytes field

source3/include/async_smb.h
source3/libsmb/async_smb.c
source3/libsmb/cliconnect.c
source3/libsmb/clientgen.c
source3/libsmb/clifile.c
source3/libsmb/clireadwrite.c
source3/libsmb/clitrans.c

index 25fd353632aa58af9c57ae1f58570246f25d1c62..fd0b0d2c539fd76cb0e54b1d2f9de375dfa86eec 100644 (file)
@@ -119,6 +119,7 @@ struct async_req *cli_request_send(TALLOC_CTX *mem_ctx,
                                   uint8_t smb_command,
                                   uint8_t additional_flags,
                                   uint8_t wct, const uint16_t *vwv,
+                                  size_t bytes_alignment,
                                   uint16_t num_bytes, const uint8_t *bytes);
 
 bool cli_chain_cork(struct cli_state *cli, struct event_context *ev,
index 522d73fbd9ecf37a553833c6d98934eaa68a959e..21ffa94fe7a38922d889f3da23f3f9bf63961b76 100644 (file)
@@ -394,6 +394,7 @@ static struct async_req *cli_request_chain(TALLOC_CTX *mem_ctx,
                                           uint8_t smb_command,
                                           uint8_t additional_flags,
                                           uint8_t wct, const uint16_t *vwv,
+                                          size_t bytes_alignment,
                                           uint16_t num_bytes,
                                           const uint8_t *bytes)
 {
@@ -423,7 +424,7 @@ static struct async_req *cli_request_chain(TALLOC_CTX *mem_ctx,
                              cli_async_req_destructor);
 
        if (!smb_splice_chain(&req->outbuf, smb_command, wct, vwv,
-                             0, num_bytes, bytes)) {
+                             bytes_alignment, num_bytes, bytes)) {
                goto fail;
        }
 
@@ -569,6 +570,7 @@ void cli_chain_uncork(struct cli_state *cli)
  * @param[in] additional_flags open_and_x wants to add oplock header flags
  * @param[in] wct              How many words?
  * @param[in] vwv              The words, already in network order
+ * @param[in] bytes_alignment  How shall we align "bytes"?
  * @param[in] num_bytes                How many bytes?
  * @param[in] bytes            The data the request ships
  *
@@ -581,6 +583,7 @@ struct async_req *cli_request_send(TALLOC_CTX *mem_ctx,
                                   uint8_t smb_command,
                                   uint8_t additional_flags,
                                   uint8_t wct, const uint16_t *vwv,
+                                  size_t bytes_alignment,
                                   uint16_t num_bytes, const uint8_t *bytes)
 {
        struct async_req *result;
@@ -596,7 +599,7 @@ struct async_req *cli_request_send(TALLOC_CTX *mem_ctx,
        }
 
        result = cli_request_chain(mem_ctx, ev, cli, smb_command,
-                                  additional_flags, wct, vwv,
+                                  additional_flags, wct, vwv, bytes_alignment,
                                   num_bytes, bytes);
 
        if (result == NULL) {
index b5287774f539a440138672b7497bea736ebdbd22..5892bdc85928834ce9613c702259c6f374ea3bc0 100644 (file)
@@ -1269,7 +1269,7 @@ struct async_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
                }
        }
 
-       result = cli_request_send(mem_ctx, ev, cli, SMBnegprot, 0, 0, NULL,
+       result = cli_request_send(mem_ctx, ev, cli, SMBnegprot, 0, 0, NULL, 0,
                                  talloc_get_size(bytes), bytes);
        TALLOC_FREE(bytes);
        return result;
index d94427809cecd7d479d1fb7d45f19d335b89fb6a..ff01b6798f9a382f698709c07bbf469ff0882ba8 100644 (file)
@@ -705,7 +705,7 @@ struct async_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
                return NULL;
        }
 
-       result = cli_request_send(mem_ctx, ev, cli, SMBecho, 0, 1, vwv,
+       result = cli_request_send(mem_ctx, ev, cli, SMBecho, 0, 1, vwv, 0,
                                  data.length, data.data);
        if (result == NULL) {
                TALLOC_FREE(data_copy);
index 733abb6510ce6f2523005440b5c236ba3b51fc83..7c75826414146248623b672a37c64fa1f470bd55 100644 (file)
@@ -895,7 +895,7 @@ struct async_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
        }
 
        result = cli_request_send(mem_ctx, ev, cli, SMBopenX, additional_flags,
-                                 15, vwv, talloc_get_size(bytes), bytes);
+                                 15, vwv, 0, talloc_get_size(bytes), bytes);
        TALLOC_FREE(bytes);
        return result;
 }
@@ -974,7 +974,7 @@ struct async_req *cli_close_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
        SSVAL(vwv+0, 0, fnum);
        SIVALS(vwv+1, 0, -1);
 
-       return cli_request_send(mem_ctx, ev, cli, SMBclose, 0, 3, vwv,
+       return cli_request_send(mem_ctx, ev, cli, SMBclose, 0, 3, vwv, 0,
                                0, NULL);
 }
 
index e0a2d21870350c0f5401436f3d29bfd0a6502e74..0c655057932b310ff80941f154ab8d06f76e49dd 100644 (file)
@@ -112,7 +112,7 @@ struct async_req *cli_read_andx_send(TALLOC_CTX *mem_ctx,
                wct += 2;
        }
 
-       result = cli_request_send(mem_ctx, ev, cli, SMBreadX, 0, wct, vwv,
+       result = cli_request_send(mem_ctx, ev, cli, SMBreadX, 0, wct, vwv, 0,
                                  0, NULL);
        if (result == NULL) {
                return NULL;
index 120b6c0e293b83c7dc7a25d130608de134b15540..baa73aeb14e199c03754d028b14af30558ed9f1b 100644 (file)
@@ -918,7 +918,7 @@ static struct async_req *cli_ship_trans(TALLOC_CTX *mem_ctx,
                 * Primary request, retrieve our mid
                 */
                result = cli_request_send(mem_ctx, state->ev, state->cli,
-                                         cmd, 0, wct, vwv,
+                                         cmd, 0, wct, vwv, 0,
                                          talloc_get_size(bytes), bytes);
                if (result == NULL) {
                        goto fail;
@@ -936,8 +936,8 @@ static struct async_req *cli_ship_trans(TALLOC_CTX *mem_ctx,
                                    wct * sizeof(uint16_t) + num_bytes + 3)) {
                        goto fail;
                }
-               result = cli_request_send(mem_ctx, state->ev, state->cli,
-                                         cmd, 0, wct, vwv, num_bytes, bytes);
+               result = cli_request_send(mem_ctx, state->ev, state->cli, cmd,
+                                         0, wct, vwv, 0, num_bytes, bytes);
                if (result == NULL) {
                        goto fail;
                }