s3:libsmb: get rid of cli_ucs2
authorLuk Claes <luk@debian.org>
Sat, 26 May 2012 10:14:51 +0000 (12:14 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 28 May 2012 14:58:03 +0000 (16:58 +0200)
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

source3/libsmb/cliconnect.c
source3/libsmb/clidfs.c
source3/libsmb/clientgen.c
source3/libsmb/clifile.c
source3/libsmb/clilist.c
source3/libsmb/clirap.c
source3/libsmb/proto.h
source3/torture/scanner.c

index 6e4003789272ad3f1974fd65de64a4b32c6a3c85..fe8c3a1631bf0b44420b1fddd2bf4b92a278bf3e 100644 (file)
@@ -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,
index 8aae42bb86a4219c4a99b4b05d829d5bb88abe67..465591590752d30c597b4ea321c3fdc34a5800b8 100644 (file)
@@ -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) {
index 58ccff9f9732686a7d0d36a489a2e4c1503d01e9..0bbcdf5c71c9027fdf8d6116e4bbcbac856ffcd6 100644 (file)
@@ -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.
 ****************************************************************************/
index b38b2e89be5f165515fc63129b476d049e8da2b1..3bdb49d6d40c560046ca682dadca3b6ce24b1e76 100644 (file)
@@ -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);
        }
index f8e8994e4aeb5045803f42c0e1deb39ef25d78f5..6185c5a99739c842ff4174f0118db0bc42bcd8f7 100644 (file)
@@ -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);
index db2d7c059c43c52d48d5f333d452e415380b9fd2..6685fbd1d8b8c5a3e306c5bbcf1abea8e7c0af07 100644 (file)
@@ -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,
index 37d23990d526e8a49e39e5d3a431659e288dc53b..e6d0ce827603178e159a894b2e8a1899413a7134 100644 (file)
@@ -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,
index 01d1456b5324a9dc1773e1dd00aae4374cd60101..f4c69c1f2ba0d66809c460106a26f7809f0cfa1f 100644 (file)
@@ -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;