diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-11-18 08:40:18 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-11-18 13:30:48 +0100 |
commit | 48bcb8c846532ccd5489ef705182fb81c5278b04 (patch) | |
tree | 9d2e4de9806a8ba8aa1a9370e070959fd49da8f1 | |
parent | 2642f385887fbd3aecd4286a4d6223a21d981714 (diff) | |
download | samba-48bcb8c846532ccd5489ef705182fb81c5278b04.tar.gz |
s3:libsmb: only align unicode pipe_name (bug #8586)
metze
-rw-r--r-- | source3/libsmb/clitrans.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c index 4bc9f4a3115..329ddcaac63 100644 --- a/source3/libsmb/clitrans.c +++ b/source3/libsmb/clitrans.c @@ -209,14 +209,18 @@ static void cli_trans_format(struct cli_trans_state *state, uint8_t *pwct, switch (cmd) { case SMBtrans: - pad[0] = 0; - iov[0].iov_base = (void *)pad; - iov[0].iov_len = 1; - iov[1].iov_base = (void *)state->pipe_name_conv; - iov[1].iov_len = state->pipe_name_conv_len; + if (cli_ucs2(state->cli)) { + pad[0] = 0; + iov[0].iov_base = (void *)pad; + iov[0].iov_len = 1; + param_offset += 1; + iov += 1; + } + iov[0].iov_base = (void *)state->pipe_name_conv; + iov[0].iov_len = state->pipe_name_conv_len; wct = 14 + state->num_setup; - param_offset += iov[0].iov_len + iov[1].iov_len; - iov += 2; + param_offset += iov[0].iov_len; + iov += 1; break; case SMBtrans2: pad[0] = 0; |