mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
s3:libsmb: get rid of cli_ucs2
Signed-off-by: Luk Claes <luk@debian.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Mon May 28 16:58:03 CEST 2012 on sn-devel-104
This commit is contained in:
parent
93ed99d6ff
commit
4688107800
@ -163,7 +163,7 @@ static struct tevent_req *cli_session_setup_lanman2_send(
|
||||
* 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);
|
||||
@ -197,7 +197,7 @@ static struct tevent_req *cli_session_setup_lanman2_send(
|
||||
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);
|
||||
|
||||
@ -205,10 +205,10 @@ static struct tevent_req *cli_session_setup_lanman2_send(
|
||||
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);
|
||||
@ -415,12 +415,12 @@ struct tevent_req *cli_session_setup_guest_create(TALLOC_CTX *mem_ctx,
|
||||
|
||||
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);
|
||||
@ -629,18 +629,18 @@ static struct tevent_req *cli_session_setup_plain_send(
|
||||
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",
|
||||
@ -648,7 +648,7 @@ static struct tevent_req *cli_session_setup_plain_send(
|
||||
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);
|
||||
|
||||
@ -985,7 +985,7 @@ static struct tevent_req *cli_session_setup_nt1_send(
|
||||
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);
|
||||
|
||||
/*
|
||||
@ -995,13 +995,13 @@ static struct tevent_req *cli_session_setup_nt1_send(
|
||||
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);
|
||||
}
|
||||
@ -1264,9 +1264,9 @@ static bool cli_sesssetup_blob_next(struct cli_sesssetup_blob_state *state,
|
||||
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;
|
||||
@ -2340,7 +2340,7 @@ struct tevent_req *cli_tcon_andx_create(TALLOC_CTX *mem_ctx,
|
||||
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);
|
||||
|
||||
@ -2863,13 +2863,13 @@ NTSTATUS cli_raw_tcon(struct cli_state *cli,
|
||||
|
||||
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,
|
||||
|
@ -648,7 +648,7 @@ NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
|
||||
}
|
||||
SSVAL(param, 0, 0x03); /* max referral level */
|
||||
|
||||
param = trans2_bytes_push_str(param, cli_ucs2(cli),
|
||||
param = trans2_bytes_push_str(param, smbXcli_conn_use_unicode(cli->conn),
|
||||
path, strlen(path)+1,
|
||||
NULL);
|
||||
if (!param) {
|
||||
|
@ -64,15 +64,6 @@ bool cli_set_backup_intent(struct cli_state *cli, bool flag)
|
||||
return old_state;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
convenience routine to find if we negotiated ucs2
|
||||
****************************************************************************/
|
||||
|
||||
bool cli_ucs2(struct cli_state *cli)
|
||||
{
|
||||
return smbXcli_conn_use_unicode(cli->conn);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Initialize Domain, user or password.
|
||||
****************************************************************************/
|
||||
|
@ -191,7 +191,7 @@ struct tevent_req *cli_setpathinfo_send(TALLOC_CTX *mem_ctx,
|
||||
SSVAL(state->param, 0, level);
|
||||
|
||||
state->param = trans2_bytes_push_str(
|
||||
state->param, cli_ucs2(cli), path, strlen(path)+1, NULL);
|
||||
state->param, smbXcli_conn_use_unicode(cli->conn), path, strlen(path)+1, NULL);
|
||||
if (tevent_req_nomem(state->param, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
@ -302,7 +302,7 @@ static struct tevent_req *cli_posix_link_internal_send(TALLOC_CTX *mem_ctx,
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
state->data = trans2_bytes_push_str(
|
||||
state->data, cli_ucs2(cli), oldname, strlen(oldname)+1, NULL);
|
||||
state->data, smbXcli_conn_use_unicode(cli->conn), oldname, strlen(oldname)+1, NULL);
|
||||
|
||||
subreq = cli_setpathinfo_send(
|
||||
state, ev, cli, level, newname,
|
||||
@ -403,7 +403,7 @@ struct tevent_req *cli_posix_readlink_send(TALLOC_CTX *mem_ctx,
|
||||
{
|
||||
struct tevent_req *req = NULL, *subreq = NULL;
|
||||
struct readlink_state *state = NULL;
|
||||
uint32_t maxbytelen = (uint32_t)(cli_ucs2(cli) ? len*3 : len);
|
||||
uint32_t maxbytelen = (uint32_t)(smbXcli_conn_use_unicode(cli->conn) ? len*3 : len);
|
||||
|
||||
req = tevent_req_create(mem_ctx, &state, struct readlink_state);
|
||||
if (req == NULL) {
|
||||
@ -464,7 +464,7 @@ NTSTATUS cli_posix_readlink_recv(struct tevent_req *req, struct cli_state *cli,
|
||||
}
|
||||
/* The returned data is a pushed string, not raw data. */
|
||||
if (!convert_string_talloc(state,
|
||||
cli_ucs2(cli) ? CH_UTF16LE : CH_DOS,
|
||||
smbXcli_conn_use_unicode(cli->conn) ? CH_UTF16LE : CH_DOS,
|
||||
CH_UNIX,
|
||||
state->data,
|
||||
state->num_data,
|
||||
@ -1048,7 +1048,7 @@ struct tevent_req *cli_rename_send(TALLOC_CTX *mem_ctx,
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), fname_src,
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), fname_src,
|
||||
strlen(fname_src)+1, NULL);
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
@ -1061,7 +1061,7 @@ struct tevent_req *cli_rename_send(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
bytes[talloc_get_size(bytes)-1] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), fname_dst,
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), fname_dst,
|
||||
strlen(fname_dst)+1, NULL);
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
@ -1170,7 +1170,7 @@ static struct tevent_req *cli_ntrename_internal_send(TALLOC_CTX *mem_ctx,
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), fname_src,
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), fname_src,
|
||||
strlen(fname_src)+1, NULL);
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
@ -1183,7 +1183,7 @@ static struct tevent_req *cli_ntrename_internal_send(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
bytes[talloc_get_size(bytes)-1] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), fname_dst,
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), fname_dst,
|
||||
strlen(fname_dst)+1, NULL);
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
@ -1370,7 +1370,7 @@ struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx,
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), fname,
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), fname,
|
||||
strlen(fname)+1, NULL);
|
||||
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
@ -1474,7 +1474,7 @@ struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), dname,
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), dname,
|
||||
strlen(dname)+1, NULL);
|
||||
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
@ -1578,7 +1578,7 @@ struct tevent_req *cli_rmdir_send(TALLOC_CTX *mem_ctx,
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), dname,
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), dname,
|
||||
strlen(dname)+1, NULL);
|
||||
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
@ -1820,12 +1820,12 @@ struct tevent_req *cli_ntcreate_send(TALLOC_CTX *mem_ctx,
|
||||
SCVAL(vwv+23, 1, SecurityFlags);
|
||||
|
||||
bytes = talloc_array(state, uint8_t, 0);
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli),
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn),
|
||||
fname, strlen(fname)+1,
|
||||
&converted_len);
|
||||
|
||||
/* sigh. this copes with broken netapp filer behaviour */
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), "", 1, NULL);
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), "", 1, NULL);
|
||||
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
@ -1989,7 +1989,7 @@ struct tevent_req *cli_nttrans_create_send(TALLOC_CTX *mem_ctx,
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
||||
param = trans2_bytes_push_str(param, cli_ucs2(cli),
|
||||
param = trans2_bytes_push_str(param, smbXcli_conn_use_unicode(cli->conn),
|
||||
fname, strlen(fname),
|
||||
&converted_len);
|
||||
if (tevent_req_nomem(param, req)) {
|
||||
@ -2192,7 +2192,7 @@ struct tevent_req *cli_openx_create(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
bytes = talloc_array(state, uint8_t, 0);
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), fname,
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), fname,
|
||||
strlen(fname)+1, NULL);
|
||||
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
@ -3415,7 +3415,7 @@ struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), fname,
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), fname,
|
||||
strlen(fname)+1, NULL);
|
||||
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
@ -3673,7 +3673,7 @@ struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), fname,
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), fname,
|
||||
strlen(fname)+1, NULL);
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
@ -3685,7 +3685,7 @@ struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
bytes[talloc_get_size(bytes)-1] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), "",
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), "",
|
||||
1, NULL);
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
@ -3791,7 +3791,7 @@ struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx,
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), fname,
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), fname,
|
||||
strlen(fname)+1, NULL);
|
||||
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
@ -4026,7 +4026,7 @@ struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx,
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), path,
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), path,
|
||||
strlen(path)+1, NULL);
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
@ -4245,7 +4245,7 @@ NTSTATUS cli_set_ea_path(struct cli_state *cli, const char *path,
|
||||
SSVAL(param,2,0);
|
||||
SSVAL(param,4,0);
|
||||
|
||||
param = trans2_bytes_push_str(param, cli_ucs2(cli),
|
||||
param = trans2_bytes_push_str(param, smbXcli_conn_use_unicode(cli->conn),
|
||||
path, strlen(path)+1,
|
||||
NULL);
|
||||
param_len = talloc_get_size(param);
|
||||
@ -4586,7 +4586,7 @@ static struct tevent_req *cli_posix_open_internal_send(TALLOC_CTX *mem_ctx,
|
||||
memset(state->param, '\0', 6);
|
||||
SSVAL(state->param, 0, SMB_POSIX_PATH_OPEN);
|
||||
|
||||
state->param = trans2_bytes_push_str(state->param, cli_ucs2(cli), fname,
|
||||
state->param = trans2_bytes_push_str(state->param, smbXcli_conn_use_unicode(cli->conn), fname,
|
||||
strlen(fname)+1, NULL);
|
||||
|
||||
if (tevent_req_nomem(state->param, req)) {
|
||||
@ -5146,7 +5146,7 @@ struct tevent_req *cli_qpathinfo_send(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
SSVAL(state->param, 0, level);
|
||||
state->param = trans2_bytes_push_str(
|
||||
state->param, cli_ucs2(cli), fname, strlen(fname)+1, NULL);
|
||||
state->param, smbXcli_conn_use_unicode(cli->conn), fname, strlen(fname)+1, NULL);
|
||||
if (tevent_req_nomem(state->param, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ static struct tevent_req *cli_list_old_send(TALLOC_CTX *mem_ctx,
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), mask,
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), mask,
|
||||
strlen(mask)+1, NULL);
|
||||
|
||||
bytes = smb_bytes_push_bytes(bytes, 5, (const uint8_t *)&zero, 2);
|
||||
@ -428,7 +428,7 @@ static void cli_list_old_done(struct tevent_req *subreq)
|
||||
return;
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(state->cli), "",
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(state->cli->conn), "",
|
||||
1, NULL);
|
||||
bytes = smb_bytes_push_bytes(bytes, 5, state->search_status,
|
||||
sizeof(state->search_status));
|
||||
@ -591,7 +591,7 @@ static struct tevent_req *cli_list_trans_send(TALLOC_CTX *mem_ctx,
|
||||
SSVAL(state->param, 6, state->info_level);
|
||||
SIVAL(state->param, 8, 0);
|
||||
|
||||
state->param = trans2_bytes_push_str(state->param, cli_ucs2(cli),
|
||||
state->param = trans2_bytes_push_str(state->param, smbXcli_conn_use_unicode(cli->conn),
|
||||
state->mask, strlen(state->mask)+1,
|
||||
NULL);
|
||||
if (tevent_req_nomem(state->param, req)) {
|
||||
@ -774,7 +774,7 @@ static void cli_list_trans_done(struct tevent_req *subreq)
|
||||
data_blob_free(&last_name_raw);
|
||||
} else {
|
||||
state->param = trans2_bytes_push_str(state->param,
|
||||
cli_ucs2(state->cli),
|
||||
smbXcli_conn_use_unicode(state->cli->conn),
|
||||
state->mask,
|
||||
strlen(state->mask)+1,
|
||||
NULL);
|
||||
|
@ -1297,7 +1297,7 @@ NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstrin
|
||||
|
||||
/* The returned data is a pushed string, not raw data. */
|
||||
if (!convert_string_talloc(talloc_tos(),
|
||||
cli_ucs2(cli) ? CH_UTF16LE : CH_DOS,
|
||||
smbXcli_conn_use_unicode(cli->conn) ? CH_UTF16LE : CH_DOS,
|
||||
CH_UNIX,
|
||||
rdata + 4,
|
||||
len,
|
||||
|
@ -181,7 +181,6 @@ struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
|
||||
DATA_BLOB data);
|
||||
NTSTATUS cli_echo_recv(struct tevent_req *req);
|
||||
NTSTATUS cli_echo(struct cli_state *cli, uint16_t num_echos, DATA_BLOB data);
|
||||
bool cli_ucs2(struct cli_state *cli);
|
||||
bool is_andx_req(uint8_t cmd);
|
||||
NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
|
||||
uint8_t smb_command, uint8_t additional_flags,
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "system/filesys.h"
|
||||
#include "torture/proto.h"
|
||||
#include "libsmb/libsmb.h"
|
||||
#include "../libcli/smb/smbXcli_base.h"
|
||||
|
||||
#define VERBOSE 0
|
||||
#define OP_MIN 0
|
||||
@ -179,7 +180,7 @@ static bool scan_trans2(struct cli_state *cli, int op, int level,
|
||||
SSVAL(param, 0, level);
|
||||
SSVAL(param, 2, 0);
|
||||
SSVAL(param, 4, 0);
|
||||
param = trans2_bytes_push_str(param, cli_ucs2(cli),
|
||||
param = trans2_bytes_push_str(param, smbXcli_conn_use_unicode(cli->conn),
|
||||
fname, strlen(fname)+1, NULL);
|
||||
if (param == NULL) return True;
|
||||
|
||||
@ -197,7 +198,7 @@ static bool scan_trans2(struct cli_state *cli, int op, int level,
|
||||
SSVAL(param, 0, level);
|
||||
SSVAL(param, 2, 0);
|
||||
SSVAL(param, 4, 0);
|
||||
param = trans2_bytes_push_str(param, cli_ucs2(cli),
|
||||
param = trans2_bytes_push_str(param, smbXcli_conn_use_unicode(cli->conn),
|
||||
newfname, strlen(newfname)+1, NULL);
|
||||
if (param == NULL) return True;
|
||||
|
||||
@ -216,7 +217,7 @@ static bool scan_trans2(struct cli_state *cli, int op, int level,
|
||||
if (param == NULL) return True;
|
||||
|
||||
SSVAL(param, 0, level);
|
||||
param = trans2_bytes_push_str(param, cli_ucs2(cli),
|
||||
param = trans2_bytes_push_str(param, smbXcli_conn_use_unicode(cli->conn),
|
||||
dname, strlen(dname)+1, NULL);
|
||||
if (param == NULL) return True;
|
||||
|
||||
@ -424,7 +425,7 @@ static bool scan_nttrans(struct cli_state *cli, int op, int level,
|
||||
SSVAL(param, 0, level);
|
||||
SSVAL(param, 2, 0);
|
||||
SSVAL(param, 4, 0);
|
||||
param = trans2_bytes_push_str(param, cli_ucs2(cli),
|
||||
param = trans2_bytes_push_str(param, smbXcli_conn_use_unicode(cli->conn),
|
||||
fname, strlen(fname)+1, NULL);
|
||||
if (param == NULL) return True;
|
||||
|
||||
@ -442,7 +443,7 @@ static bool scan_nttrans(struct cli_state *cli, int op, int level,
|
||||
SSVAL(param, 0, level);
|
||||
SSVAL(param, 2, 0);
|
||||
SSVAL(param, 4, 0);
|
||||
param = trans2_bytes_push_str(param, cli_ucs2(cli),
|
||||
param = trans2_bytes_push_str(param, smbXcli_conn_use_unicode(cli->conn),
|
||||
newfname, strlen(newfname)+1, NULL);
|
||||
if (param == NULL) return True;
|
||||
|
||||
@ -461,7 +462,7 @@ static bool scan_nttrans(struct cli_state *cli, int op, int level,
|
||||
if (param == NULL) return True;
|
||||
|
||||
SSVAL(param, 0, level);
|
||||
param = trans2_bytes_push_str(param, cli_ucs2(cli),
|
||||
param = trans2_bytes_push_str(param, smbXcli_conn_use_unicode(cli->conn),
|
||||
dname, strlen(dname)+1, NULL);
|
||||
if (param == NULL) return True;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user