*******************************************************/
static NTSTATUS smb_bytes_talloc_string(TALLOC_CTX *mem_ctx,
- char *inbuf,
+ const uint8_t *hdr,
char **dest,
uint8_t *src,
size_t srclen,
ssize_t *destlen)
{
*destlen = clistr_pull_talloc(mem_ctx,
- inbuf,
- SVAL(inbuf, smb_flg2),
+ (const char *)hdr,
+ SVAL(hdr, HDR_FLG2),
dest,
(char *)src,
srclen,
* Plaintext mode needed, assume plaintext supplied.
*/
buf = talloc_array(talloc_tos(), uint8_t, 0);
- buf = smb_bytes_push_str(buf, cli_ucs2(cli), pass, passlen+1,
+ buf = smb_bytes_push_str(buf, smbXcli_conn_use_unicode(cli->conn), pass, passlen+1,
&converted_size);
if (tevent_req_nomem(buf, req)) {
return tevent_req_post(req, ev);
if (tevent_req_nomem(tmp, req)) {
return tevent_req_post(req, ev);
}
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), tmp, strlen(tmp)+1,
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), tmp, strlen(tmp)+1,
NULL);
TALLOC_FREE(tmp);
if (tevent_req_nomem(tmp, req)) {
return tevent_req_post(req, ev);
}
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), tmp, strlen(tmp)+1,
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), tmp, strlen(tmp)+1,
NULL);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), "Unix", 5, NULL);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), "Samba", 6, NULL);
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), "Unix", 5, NULL);
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), "Samba", 6, NULL);
if (tevent_req_nomem(bytes, req)) {
return tevent_req_post(req, ev);
struct cli_state *cli = state->cli;
uint32_t num_bytes;
uint8_t *in;
- char *inbuf;
+ uint8_t *inhdr;
uint8_t *bytes;
uint8_t *p;
NTSTATUS status;
return;
}
- inbuf = (char *)in;
+ inhdr = in + NBT_HDR_SIZE;
p = bytes;
- cli_state_set_uid(state->cli, SVAL(inbuf, smb_uid));
+ cli_state_set_uid(state->cli, SVAL(inhdr, HDR_UID));
cli->is_guestlogin = ((SVAL(vwv+2, 0) & 1) != 0);
status = smb_bytes_talloc_string(cli,
- inbuf,
+ inhdr,
&cli->server_os,
p,
bytes+num_bytes-p,
p += ret;
status = smb_bytes_talloc_string(cli,
- inbuf,
+ inhdr,
&cli->server_type,
p,
bytes+num_bytes-p,
p += ret;
status = smb_bytes_talloc_string(cli,
- inbuf,
+ inhdr,
&cli->server_domain,
p,
bytes+num_bytes-p,
struct tevent_req *req;
NTSTATUS status = NT_STATUS_NO_MEMORY;
- if (cli_has_async_calls(cli)) {
+ if (smbXcli_conn_has_async_calls(cli->conn)) {
/*
* Can't use sync call while an async call is in flight
*/
bytes = talloc_array(state, uint8_t, 0);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), "", 1, /* username */
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), "", 1, /* username */
NULL);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), "", 1, /* workgroup */
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), "", 1, /* workgroup */
NULL);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), "Unix", 5, NULL);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), "Samba", 6, NULL);
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), "Unix", 5, NULL);
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), "Samba", 6, NULL);
if (bytes == NULL) {
TALLOC_FREE(req);
return NULL;
}
- status = cli_smb_req_send(subreq);
+ status = smb1cli_req_chain_submit(&subreq, 1);
if (NT_STATUS_IS_OK(status)) {
tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
struct cli_state *cli = state->cli;
uint32_t num_bytes;
uint8_t *in;
- char *inbuf;
+ uint8_t *inhdr;
uint8_t *bytes;
uint8_t *p;
NTSTATUS status;
return;
}
- inbuf = (char *)in;
+ inhdr = in + NBT_HDR_SIZE;
p = bytes;
- cli_state_set_uid(state->cli, SVAL(inbuf, smb_uid));
+ cli_state_set_uid(state->cli, SVAL(inhdr, HDR_UID));
cli->is_guestlogin = ((SVAL(vwv+2, 0) & 1) != 0);
status = smb_bytes_talloc_string(cli,
- inbuf,
+ inhdr,
&cli->server_os,
p,
bytes+num_bytes-p,
p += ret;
status = smb_bytes_talloc_string(cli,
- inbuf,
+ inhdr,
&cli->server_type,
p,
bytes+num_bytes-p,
p += ret;
status = smb_bytes_talloc_string(cli,
- inbuf,
+ inhdr,
&cli->server_domain,
p,
bytes+num_bytes-p,
struct tevent_req *req;
NTSTATUS status = NT_STATUS_OK;
- if (cli_has_async_calls(cli)) {
+ if (smbXcli_conn_has_async_calls(cli->conn)) {
/*
* Can't use sync call while an async call is in flight
*/
SIVAL(vwv+11, 0, cli_session_setup_capabilities(cli, 0));
bytes = talloc_array(state, uint8_t, 0);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), pass, strlen(pass)+1,
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), pass, strlen(pass)+1,
&passlen);
if (tevent_req_nomem(bytes, req)) {
return tevent_req_post(req, ev);
}
- SSVAL(vwv + (cli_ucs2(cli) ? 8 : 7), 0, passlen);
+ SSVAL(vwv + (smbXcli_conn_use_unicode(cli->conn) ? 8 : 7), 0, passlen);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli),
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn),
user, strlen(user)+1, NULL);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli),
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn),
workgroup, strlen(workgroup)+1, NULL);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli),
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn),
"Unix", 5, NULL);
version = talloc_asprintf(talloc_tos(), "Samba %s",
if (tevent_req_nomem(version, req)){
return tevent_req_post(req, ev);
}
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli),
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn),
version, strlen(version)+1, NULL);
TALLOC_FREE(version);
struct cli_state *cli = state->cli;
uint32_t num_bytes;
uint8_t *in;
- char *inbuf;
+ uint8_t *inhdr;
uint8_t *bytes;
uint8_t *p;
NTSTATUS status;
return;
}
- inbuf = (char *)in;
+ inhdr = in + NBT_HDR_SIZE;
p = bytes;
- cli_state_set_uid(state->cli, SVAL(inbuf, smb_uid));
+ cli_state_set_uid(state->cli, SVAL(inhdr, HDR_UID));
cli->is_guestlogin = ((SVAL(vwv+2, 0) & 1) != 0);
status = smb_bytes_talloc_string(cli,
- inbuf,
+ inhdr,
&cli->server_os,
p,
bytes+num_bytes-p,
p += ret;
status = smb_bytes_talloc_string(cli,
- inbuf,
+ inhdr,
&cli->server_type,
p,
bytes+num_bytes-p,
p += ret;
status = smb_bytes_talloc_string(cli,
- inbuf,
+ inhdr,
&cli->server_domain,
p,
bytes+num_bytes-p,
struct tevent_req *req;
NTSTATUS status = NT_STATUS_NO_MEMORY;
- if (cli_has_async_calls(cli)) {
+ if (smbXcli_conn_has_async_calls(cli->conn)) {
/*
* Can't use sync call while an async call is in flight
*/
data_blob_free(&lm_response);
data_blob_free(&nt_response);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli),
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn),
user, strlen(user)+1, NULL);
/*
if (tevent_req_nomem(workgroup_upper, req)) {
return tevent_req_post(req, ev);
}
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli),
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn),
workgroup_upper, strlen(workgroup_upper)+1,
NULL);
TALLOC_FREE(workgroup_upper);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), "Unix", 5, NULL);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), "Samba", 6, NULL);
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), "Unix", 5, NULL);
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), "Samba", 6, NULL);
if (tevent_req_nomem(bytes, req)) {
return tevent_req_post(req, ev);
}
struct cli_state *cli = state->cli;
uint32_t num_bytes;
uint8_t *in;
- char *inbuf;
+ uint8_t *inhdr;
uint8_t *bytes;
uint8_t *p;
NTSTATUS status;
return;
}
- inbuf = (char *)in;
+ inhdr = in + NBT_HDR_SIZE;
p = bytes;
- cli_state_set_uid(state->cli, SVAL(inbuf, smb_uid));
+ cli_state_set_uid(state->cli, SVAL(inhdr, HDR_UID));
cli->is_guestlogin = ((SVAL(vwv+2, 0) & 1) != 0);
status = smb_bytes_talloc_string(cli,
- inbuf,
+ inhdr,
&cli->server_os,
p,
bytes+num_bytes-p,
p += ret;
status = smb_bytes_talloc_string(cli,
- inbuf,
+ inhdr,
&cli->server_type,
p,
bytes+num_bytes-p,
p += ret;
status = smb_bytes_talloc_string(cli,
- inbuf,
+ inhdr,
&cli->server_domain,
p,
bytes+num_bytes-p,
if (tevent_req_nterror(req, status)) {
return;
}
- if (cli_simple_set_signing(cli, state->session_key, state->response)
- && !cli_check_sign_mac(cli, (char *)in, 1)) {
+ if (smb1cli_conn_activate_signing(cli->conn, state->session_key, state->response)
+ && !smb1cli_conn_check_signing(cli->conn, (uint8_t *)in, 1)) {
tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED);
return;
}
struct tevent_req *req;
NTSTATUS status = NT_STATUS_NO_MEMORY;
- if (cli_has_async_calls(cli)) {
+ if (smbXcli_conn_has_async_calls(cli->conn)) {
/*
* Can't use sync call while an async call is in flight
*/
struct iovec *recv_iov;
NTSTATUS status;
- char *inbuf;
+ uint8_t *inbuf;
DATA_BLOB ret_blob;
};
state->blob.data += thistime;
state->blob.length -= thistime;
- state->buf = smb_bytes_push_str(state->buf, cli_ucs2(state->cli),
+ state->buf = smb_bytes_push_str(state->buf, smbXcli_conn_use_unicode(state->cli->conn),
"Unix", 5, NULL);
- state->buf = smb_bytes_push_str(state->buf, cli_ucs2(state->cli),
+ state->buf = smb_bytes_push_str(state->buf, smbXcli_conn_use_unicode(state->cli->conn),
"Samba", 6, NULL);
if (state->buf == NULL) {
return false;
NTSTATUS status;
uint8_t *p;
uint16_t blob_length;
- uint8_t *inbuf;
+ uint8_t *in;
+ uint8_t *inhdr;
ssize_t ret;
if (smbXcli_conn_protocol(state->cli->conn) >= PROTOCOL_SMB2_02) {
&state->recv_iov,
&state->ret_blob);
} else {
- status = cli_smb_recv(subreq, state, &inbuf, 4, &wct, &vwv,
+ status = cli_smb_recv(subreq, state, &in, 4, &wct, &vwv,
&num_bytes, &bytes);
TALLOC_FREE(state->buf);
}
goto next;
}
- state->inbuf = (char *)inbuf;
- cli_state_set_uid(state->cli, SVAL(inbuf, smb_uid));
+ state->inbuf = in;
+ inhdr = in + NBT_HDR_SIZE;
+ cli_state_set_uid(state->cli, SVAL(inhdr, HDR_UID));
cli->is_guestlogin = ((SVAL(vwv+2, 0) & 1) != 0);
blob_length = SVAL(vwv+3, 0);
p = bytes + blob_length;
status = smb_bytes_talloc_string(cli,
- (char *)inbuf,
+ inhdr,
&cli->server_os,
p,
bytes+num_bytes-p,
p += ret;
status = smb_bytes_talloc_string(cli,
- (char *)inbuf,
+ inhdr,
&cli->server_type,
p,
bytes+num_bytes-p,
p += ret;
status = smb_bytes_talloc_string(cli,
- (char *)inbuf,
+ inhdr,
&cli->server_domain,
p,
bytes+num_bytes-p,
static NTSTATUS cli_sesssetup_blob_recv(struct tevent_req *req,
TALLOC_CTX *mem_ctx,
DATA_BLOB *pblob,
- char **pinbuf,
+ uint8_t **pinbuf,
struct iovec **precv_iov)
{
struct cli_sesssetup_blob_state *state = tevent_req_data(
req, struct cli_sesssetup_blob_state);
NTSTATUS status;
- char *inbuf;
+ uint8_t *inbuf;
struct iovec *recv_iov;
if (tevent_req_is_nterror(req, &status)) {
subreq, struct tevent_req);
struct cli_session_setup_kerberos_state *state = tevent_req_data(
req, struct cli_session_setup_kerberos_state);
- char *inbuf = NULL;
+ uint8_t *inbuf = NULL;
struct iovec *recv_iov = NULL;
NTSTATUS status;
return;
}
} else {
- if (cli_simple_set_signing(state->cli, state->session_key_krb5,
+ if (smb1cli_conn_activate_signing(state->cli->conn, state->session_key_krb5,
data_blob_null)
- && !cli_check_sign_mac(state->cli, inbuf, 1)) {
+ && !smb1cli_conn_check_signing(state->cli->conn, inbuf, 1)) {
tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED);
return;
}
struct tevent_req *req;
ADS_STATUS status = ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
- if (cli_has_async_calls(cli)) {
+ if (smbXcli_conn_has_async_calls(cli->conn)) {
return ADS_ERROR_NT(NT_STATUS_INVALID_PARAMETER);
}
ev = tevent_context_init(talloc_tos());
struct cli_session_setup_ntlmssp_state *state = tevent_req_data(
req, struct cli_session_setup_ntlmssp_state);
DATA_BLOB blob_in, msg_in, blob_out;
- char *inbuf = NULL;
+ uint8_t *inbuf = NULL;
struct iovec *recv_iov = NULL;
bool parse_ret;
NTSTATUS status;
return;
}
} else {
- if (cli_simple_set_signing(
- state->cli, state->ntlmssp_state->session_key,
+ if (smb1cli_conn_activate_signing(
+ state->cli->conn, state->ntlmssp_state->session_key,
data_blob_null)
- && !cli_check_sign_mac(state->cli, inbuf, 1)) {
+ && !smb1cli_conn_check_signing(state->cli->conn, inbuf, 1)) {
tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED);
return;
}
struct tevent_req *req;
NTSTATUS status = NT_STATUS_NO_MEMORY;
- if (cli_has_async_calls(cli)) {
+ if (smbXcli_conn_has_async_calls(cli->conn)) {
return NT_STATUS_INVALID_PARAMETER;
}
ev = tevent_context_init(talloc_tos());
if ((sec_mode & NEGOTIATE_SECURITY_CHALLENGE_RESPONSE) == 0 &&
!lp_client_plaintext_auth() && (*pass)) {
- DEBUG(1, ("Server requested LM password but 'client plaintext auth = no'"
+ DEBUG(1, ("Server requested PLAINTEXT password but 'client plaintext auth = no'"
" or 'client ntlmv2 auth = yes'\n"));
return NT_STATUS_ACCESS_DENIED;
}
if ((sec_mode & NEGOTIATE_SECURITY_CHALLENGE_RESPONSE) == 0) {
if (!lp_client_plaintext_auth() && (*pass)) {
- DEBUG(1, ("Server requested LM password but 'client plaintext auth = no'"
+ DEBUG(1, ("Server requested PLAINTEXT password but 'client plaintext auth = no'"
" or 'client ntlmv2 auth = yes'\n"));
return NT_STATUS_ACCESS_DENIED;
}
struct tevent_req *req;
NTSTATUS status = NT_STATUS_NO_MEMORY;
- if (cli_has_async_calls(cli)) {
+ if (smbXcli_conn_has_async_calls(cli->conn)) {
return NT_STATUS_INVALID_PARAMETER;
}
ev = tevent_context_init(talloc_tos());
uint8_t *tmp_pass;
if (!lp_client_plaintext_auth() && (*pass)) {
- DEBUG(1, ("Server requested plaintext "
+ DEBUG(1, ("Server requested PLAINTEXT "
"password but "
- "'client lanman auth = no' or 'client ntlmv2 auth = yes'\n"));
+ "'client plaintext auth = no' or 'client ntlmv2 auth = yes'\n"));
goto access_denied;
}
TALLOC_FREE(req);
return NULL;
}
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), tmp, strlen(tmp)+1,
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), tmp, strlen(tmp)+1,
NULL);
TALLOC_FREE(tmp);
if (subreq == NULL) {
return req;
}
- status = cli_smb_req_send(subreq);
+ status = smb1cli_req_chain_submit(&subreq, 1);
if (!NT_STATUS_IS_OK(status)) {
tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
req, struct cli_tcon_andx_state);
struct cli_state *cli = state->cli;
uint8_t *in;
- char *inbuf;
+ uint8_t *inhdr;
uint8_t wct;
uint16_t *vwv;
uint32_t num_bytes;
return;
}
- inbuf = (char *)in;
+ inhdr = in + NBT_HDR_SIZE;
if (num_bytes) {
if (clistr_pull_talloc(cli,
- inbuf,
- SVAL(inbuf, smb_flg2),
+ (const char *)inhdr,
+ SVAL(inhdr, HDR_FLG2),
&cli->dev,
bytes,
num_bytes,
cli->dfsroot = ((SVAL(vwv+2, 0) & SMB_SHARE_IN_DFS) != 0);
}
- cli->smb1.tid = SVAL(inbuf,smb_tid);
+ cli->smb1.tid = SVAL(inhdr, HDR_TID);
tevent_req_done(req);
}
struct tevent_req *req;
NTSTATUS status = NT_STATUS_OK;
- if (cli_has_async_calls(cli)) {
+ if (smbXcli_conn_has_async_calls(cli->conn)) {
/*
* Can't use sync call while an async call is in flight
*/
NTSTATUS cli_tree_connect(struct cli_state *cli, const char *share,
const char *dev, const char *pass, int passlen)
{
+ NTSTATUS status;
+ uint16_t max_xmit = 0;
+ uint16_t tid = 0;
+
cli->share = talloc_strdup(cli, share);
if (!cli->share) {
return NT_STATUS_NO_MEMORY;
return smb2cli_tcon(cli, share);
}
- return cli_tcon_andx(cli, share, dev, pass, passlen);
+ if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_LANMAN1) {
+ return cli_tcon_andx(cli, share, dev, pass, passlen);
+ }
+
+ status = cli_raw_tcon(cli, share, pass, dev, &max_xmit, &tid);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+ cli->smb1.tid = tid;
+
+ return NT_STATUS_OK;
}
/****************************************************************************
struct tevent_req *req;
NTSTATUS status = NT_STATUS_NO_MEMORY;
- if (cli_has_async_calls(cli)) {
+ if (smbXcli_conn_has_async_calls(cli->conn)) {
return NT_STATUS_INVALID_PARAMETER;
}
ev = tevent_context_init(talloc_tos());
return status;
}
-struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- struct cli_state *cli,
- enum protocol_types max_protocol)
-{
- return smbXcli_negprot_send(mem_ctx, ev,
- cli->conn, cli->timeout,
- PROTOCOL_CORE, max_protocol);
-}
-
-NTSTATUS cli_negprot_recv(struct tevent_req *req)
-{
- return smbXcli_negprot_recv(req);
-}
-
-NTSTATUS cli_negprot(struct cli_state *cli, enum protocol_types max_protocol)
-{
- return smbXcli_negprot(cli->conn, cli->timeout,
- PROTOCOL_CORE, max_protocol);
-}
-
static NTSTATUS cli_connect_sock(const char *host, int name_type,
const struct sockaddr_storage *pss,
const char *myname, uint16_t port,
return nt_status;
}
- nt_status = cli_negprot(cli, PROTOCOL_NT1);
+ nt_status = smbXcli_negprot(cli->conn, cli->timeout, PROTOCOL_CORE,
+ PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(1, ("failed negprot: %s\n", nt_errstr(nt_status)));
cli_shutdown(cli);
}
if (service) {
- nt_status = cli_tcon_andx(cli, service, service_type, password,
- pw_len);
+ nt_status = cli_tree_connect(cli, service, service_type,
+ password, pw_len);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(1,("failed tcon_X with %s\n", nt_errstr(nt_status)));
cli_shutdown(cli);
NTSTATUS status;
if (!lp_client_plaintext_auth() && (*pass)) {
- DEBUG(1, ("Server requested plaintext password but 'client "
- "plaintext auth' is disabled\n"));
+ DEBUG(1, ("Server requested PLAINTEXT password but 'client plaintext auth = no'"
+ " or 'client ntlmv2 auth = yes'\n"));
return NT_STATUS_ACCESS_DENIED;
}
bytes = talloc_array(talloc_tos(), uint8_t, 0);
bytes = smb_bytes_push_bytes(bytes, 4, NULL, 0);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli),
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn),
service, strlen(service)+1, NULL);
bytes = smb_bytes_push_bytes(bytes, 4, NULL, 0);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli),
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn),
pass, strlen(pass)+1, NULL);
bytes = smb_bytes_push_bytes(bytes, 4, NULL, 0);
- bytes = smb_bytes_push_str(bytes, cli_ucs2(cli),
+ bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn),
dev, strlen(dev)+1, NULL);
status = cli_smb(talloc_tos(), cli, SMBtcon, 0, 0, NULL,