summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-12-19 17:44:32 +0100
committerVolker Lendecke <vl@samba.org>2008-12-19 17:47:30 +0100
commit1f04d07db0d53630d400ed35cecf7c66d3bb491c (patch)
tree0f1e3a2c8e7fad7f5ffd726275ff02f5a3043ab1 /source3/libsmb
parent398ef0fb855b3b2d6e55ae26304589fd89110628 (diff)
downloadsamba-1f04d07db0d53630d400ed35cecf7c66d3bb491c.tar.gz
samba-1f04d07db0d53630d400ed35cecf7c66d3bb491c.tar.bz2
samba-1f04d07db0d53630d400ed35cecf7c66d3bb491c.zip
Convert cli_request->outbuf to uint8_t
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/async_smb.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index a5ce505908..9ef9f9e06d 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -127,7 +127,7 @@ static char *cli_request_print(TALLOC_CTX *mem_ctx, struct async_req *req)
static int cli_request_destructor(struct cli_request *req)
{
if (req->enc_state != NULL) {
- common_free_enc_buffer(req->enc_state, req->outbuf);
+ common_free_enc_buffer(req->enc_state, (char *)req->outbuf);
}
DLIST_REMOVE(req->cli->outstanding_requests, req);
if (req->cli->outstanding_requests == NULL) {
@@ -187,7 +187,7 @@ static bool is_andx_req(uint8_t cmd)
* to the chain. Find the offset to the place where we have to put our cmd.
*/
-static bool find_andx_cmd_ofs(char *buf, size_t *pofs)
+static bool find_andx_cmd_ofs(uint8_t *buf, size_t *pofs)
{
uint8_t cmd;
size_t ofs;
@@ -231,12 +231,12 @@ static bool find_andx_cmd_ofs(char *buf, size_t *pofs)
* *poutbuf.
*/
-bool smb_splice_chain(char **poutbuf, uint8_t smb_command,
+bool smb_splice_chain(uint8_t **poutbuf, uint8_t smb_command,
uint8_t wct, const uint16_t *vwv,
size_t bytes_alignment,
uint32_t num_bytes, const uint8_t *bytes)
{
- char *outbuf;
+ uint8_t *outbuf;
size_t old_size, new_size;
size_t ofs;
size_t chain_padding = 0;
@@ -280,7 +280,7 @@ bool smb_splice_chain(char **poutbuf, uint8_t smb_command,
return false;
}
- outbuf = TALLOC_REALLOC_ARRAY(NULL, *poutbuf, char, new_size);
+ outbuf = TALLOC_REALLOC_ARRAY(NULL, *poutbuf, uint8_t, new_size);
if (outbuf == NULL) {
DEBUG(0, ("talloc failed\n"));
return false;
@@ -295,7 +295,7 @@ bool smb_splice_chain(char **poutbuf, uint8_t smb_command,
if (!find_andx_cmd_ofs(outbuf, &andx_cmd_ofs)) {
DEBUG(1, ("invalid command chain\n"));
*poutbuf = TALLOC_REALLOC_ARRAY(
- NULL, *poutbuf, char, old_size);
+ NULL, *poutbuf, uint8_t, old_size);
return false;
}
@@ -512,11 +512,12 @@ bool cli_chain_cork(struct cli_state *cli, struct event_context *ev,
if (size_hint == 0) {
size_hint = 100;
}
- req->outbuf = talloc_array(req, char, smb_wct + size_hint);
+ req->outbuf = talloc_array(req, uint8_t, smb_wct + size_hint);
if (req->outbuf == NULL) {
goto fail;
}
- req->outbuf = TALLOC_REALLOC_ARRAY(NULL, req->outbuf, char, smb_wct);
+ req->outbuf = TALLOC_REALLOC_ARRAY(NULL, req->outbuf, uint8_t,
+ smb_wct);
req->num_async = 0;
req->async = NULL;
@@ -525,7 +526,7 @@ bool cli_chain_cork(struct cli_state *cli, struct event_context *ev,
req->recv_helper.fn = NULL;
SSVAL(req->outbuf, smb_tid, cli->cnum);
- cli_setup_packet_buf(cli, req->outbuf);
+ cli_setup_packet_buf(cli, (char *)req->outbuf);
req->mid = cli_new_mid(cli);
@@ -559,22 +560,23 @@ void cli_chain_uncork(struct cli_state *cli)
cli->chain_accumulator = NULL;
SSVAL(req->outbuf, smb_mid, req->mid);
- smb_setlen(req->outbuf, talloc_get_size(req->outbuf) - 4);
+ smb_setlen((char *)req->outbuf, talloc_get_size(req->outbuf) - 4);
- cli_calculate_sign_mac(cli, req->outbuf);
+ cli_calculate_sign_mac(cli, (char *)req->outbuf);
if (cli_encryption_on(cli)) {
NTSTATUS status;
char *enc_buf;
- status = cli_encrypt_message(cli, req->outbuf, &enc_buf);
+ status = cli_encrypt_message(cli, (char *)req->outbuf,
+ &enc_buf);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("Error in encrypting client message. "
"Error %s\n", nt_errstr(status)));
TALLOC_FREE(req);
return;
}
- req->outbuf = enc_buf;
+ req->outbuf = (uint8_t *)enc_buf;
req->enc_state = cli->trans_enc_state;
}