The branch, master has been updated via 4688107 s3:libsmb: get rid of cli_ucs2 via 93ed99d s3:libsmb: get rid of clisigning routines via f7f73c4 s3:libsmb: get rid of cli_has_async_calls via 764b5e5 s3:libsmb: get rid of cli_negprot via 82895ab s3:libsmb: get rid of cli_state_disconnect via 1ff8c40 s3:libsmb: get rid of cli_state_server_time_zone via 278ba99 s3:libsmb: get rid of cli_state_security_mode via 5f10bd9 s3:libsmb: get rid of cli_state_server_gss_blob via 2be7e23 s3:libsmb: get rid of cli_state_server_challenge via ab052c7 s3:libsmb: get rid of cli_state_encryption_on via 6c18a66 s3:libsmb: get rid of cli_state_max_requests via 7c69ca0 s3:libsmb: get rid of cli_state_server_session_key via 3c9c06a s3:libsmb: get rid of cli_state_capabilities via d8c0646 s3:libsmb: get rid of cli_state_protocol via 4f6f4ea s3:libsmb: get rid of cli_state_remote_name via 987e81b s3:libsmb: get rid of cli_state_*_sockaddr via 8e24e7f s3:libsmb: get rid of cli_sockopt via f43231c s3:libsmb: remove unused (un)set_pending functions from bf38a5d Avoid all(), as it's not available in Python 2.4.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 4688107800216a86646bc4838f7a485bae091370 Author: Luk Claes <l...@debian.org> Date: Sat May 26 12:14:51 2012 +0200 s3:libsmb: get rid of cli_ucs2 Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> Autobuild-User: Stefan Metzmacher <me...@samba.org> Autobuild-Date: Mon May 28 16:58:03 CEST 2012 on sn-devel-104 commit 93ed99d6ffb948e9ddde9ddc7280b33fc86adc75 Author: Luk Claes <l...@debian.org> Date: Sat May 26 12:07:38 2012 +0200 s3:libsmb: get rid of clisigning routines Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit f7f73c4dbad4dc47e3f37cd09f90470c2e54a4c2 Author: Luk Claes <l...@debian.org> Date: Sat May 26 11:45:09 2012 +0200 s3:libsmb: get rid of cli_has_async_calls Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 764b5e56108362a53acf8f435203dd1e56ecd2ce Author: Luk Claes <l...@debian.org> Date: Sun May 20 17:54:29 2012 +0200 s3:libsmb: get rid of cli_negprot Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 82895ab22fb19fabe43ec29365dbe33da0b917f2 Author: Luk Claes <l...@debian.org> Date: Sun May 20 16:26:25 2012 +0200 s3:libsmb: get rid of cli_state_disconnect Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 1ff8c404a64ea583b8265441edfb78c3613134dd Author: Luk Claes <l...@debian.org> Date: Sat May 19 18:50:27 2012 +0200 s3:libsmb: get rid of cli_state_server_time_zone Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 278ba9928ab0f36c933f3190aee136bbc964055a Author: Luk Claes <l...@debian.org> Date: Sat May 19 18:47:31 2012 +0200 s3:libsmb: get rid of cli_state_security_mode Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 5f10bd9fe4d8738564ea9674645b6521c131dccf Author: Luk Claes <l...@debian.org> Date: Sat May 19 18:44:48 2012 +0200 s3:libsmb: get rid of cli_state_server_gss_blob Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 2be7e23b99db92cf55421607a67911f0ecae3790 Author: Luk Claes <l...@debian.org> Date: Sat May 19 18:42:56 2012 +0200 s3:libsmb: get rid of cli_state_server_challenge Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit ab052c7ff0cdaa7b64c20e2d658e4c46d6c66234 Author: Luk Claes <l...@debian.org> Date: Sat May 19 18:39:44 2012 +0200 s3:libsmb: get rid of cli_state_encryption_on Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 6c18a66f3e84b8587deb25390e5ee9f6d531a3be Author: Luk Claes <l...@debian.org> Date: Sat May 19 18:35:51 2012 +0200 s3:libsmb: get rid of cli_state_max_requests Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 7c69ca09d0a847262b3e5981c12331c70bf1ce35 Author: Luk Claes <l...@debian.org> Date: Sat May 19 18:32:51 2012 +0200 s3:libsmb: get rid of cli_state_server_session_key Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 3c9c06ac05635dc0af3b29b15c3f568cbf57afdd Author: Luk Claes <l...@debian.org> Date: Sat May 19 18:23:40 2012 +0200 s3:libsmb: get rid of cli_state_capabilities Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit d8c0646a5db34a390ceeb853e50c2d098b992c85 Author: Luk Claes <l...@debian.org> Date: Sat May 19 18:09:30 2012 +0200 s3:libsmb: get rid of cli_state_protocol Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 4f6f4ea93c83fa5154f450e2e43649467e4c2b32 Author: Luk Claes <l...@debian.org> Date: Sat May 19 17:31:50 2012 +0200 s3:libsmb: get rid of cli_state_remote_name Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 987e81b0ee681a25a8e3308169626a2206e3fd26 Author: Luk Claes <l...@debian.org> Date: Sat May 19 17:15:23 2012 +0200 s3:libsmb: get rid of cli_state_*_sockaddr Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 8e24e7f6b81871876e14f73424fe44bf26280560 Author: Luk Claes <l...@debian.org> Date: Sat May 19 16:58:28 2012 +0200 s3:libsmb: get rid of cli_sockopt Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit f43231c051d3be40b8676dd401e9511948b69bba Author: Luk Claes <l...@debian.org> Date: Sat May 19 16:21:14 2012 +0200 s3:libsmb: remove unused (un)set_pending functions Signed-off-by: Luk Claes <l...@debian.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> ----------------------------------------------------------------------- Summary of changes: source3/Makefile.in | 1 - source3/client/client.c | 5 +- source3/include/async_smb.h | 3 - source3/include/smb_macros.h | 2 +- source3/lib/netapi/cm.c | 5 +- source3/libnet/libnet_join.c | 9 +- source3/libsmb/async_smb.c | 19 +--- source3/libsmb/cli_np_tstream.c | 2 +- source3/libsmb/cliconnect.c | 168 ++++++++++++--------------- source3/libsmb/clidfs.c | 32 +++--- source3/libsmb/clientgen.c | 87 +------------- source3/libsmb/clierror.c | 9 -- source3/libsmb/clifile.c | 145 ++++++++++++------------ source3/libsmb/clifsinfo.c | 8 +- source3/libsmb/clilist.c | 33 +++--- source3/libsmb/climessage.c | 3 +- source3/libsmb/clioplock.c | 3 +- source3/libsmb/cliprint.c | 3 +- source3/libsmb/clirap.c | 17 ++-- source3/libsmb/clirap2.c | 7 +- source3/libsmb/clireadwrite.c | 27 +++-- source3/libsmb/clisigning.c | 45 ------- source3/libsmb/clisymlink.c | 5 +- source3/libsmb/clitrans.c | 4 +- source3/libsmb/libsmb_context.c | 4 +- source3/libsmb/libsmb_dir.c | 5 +- source3/libsmb/libsmb_file.c | 4 +- source3/libsmb/libsmb_server.c | 12 +- source3/libsmb/libsmb_stat.c | 4 +- source3/libsmb/passchange.c | 4 +- source3/libsmb/proto.h | 29 ----- source3/libsmb/smb2cli_tcon.c | 6 +- source3/nmbd/nmbd_synclists.c | 4 +- source3/rpc_client/cli_pipe.c | 5 +- source3/rpc_client/cli_pipe_schannel.c | 13 +- source3/rpc_server/spoolss/srv_spoolss_nt.c | 3 +- source3/rpcclient/rpcclient.c | 5 +- source3/torture/locktest.c | 4 +- source3/torture/masktest.c | 6 +- source3/torture/scanner.c | 13 +- source3/torture/torture.c | 112 +++++++++--------- source3/utils/net_rap.c | 5 +- source3/utils/net_rpc.c | 14 ++- source3/utils/net_rpc_join.c | 9 +- source3/utils/net_rpc_printer.c | 17 ++-- source3/utils/net_time.c | 6 +- source3/winbindd/winbindd_cm.c | 24 ++-- source3/wscript_build | 1 - 48 files changed, 396 insertions(+), 555 deletions(-) delete mode 100644 source3/libsmb/clisigning.c Changeset truncated at 500 lines: diff --git a/source3/Makefile.in b/source3/Makefile.in index 0908637..88872ad 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -613,7 +613,6 @@ LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \ libsmb/clistr.o libsmb/cliquota.o libsmb/clifsinfo.o libsmb/clidfs.o \ libsmb/clioplock.o libsmb/clirap2.o \ libsmb/async_smb.o \ - libsmb/clisigning.o \ ../libcli/smb/smb_seal.o \ ../libcli/smb/read_smb.o \ ../libcli/smb/smbXcli_base.o \ diff --git a/source3/client/client.c b/source3/client/client.c index 3d36367..42c5efc 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -37,6 +37,7 @@ #include "trans2.h" #include "libsmb/nmblib.h" #include "include/ntioctl.h" +#include "../libcli/smb/smbXcli_base.h" #ifndef REGISTER #define REGISTER 0 @@ -427,7 +428,7 @@ static int do_cd(const char *new_dir) /* Use a trans2_qpathinfo to test directories for modern servers. Except Win9x doesn't support the qpathinfo_basic() call..... */ - if (cli_state_protocol(targetcli) > PROTOCOL_LANMAN2 && !targetcli->win95) { + if (smbXcli_conn_protocol(targetcli->conn) > PROTOCOL_LANMAN2 && !targetcli->win95) { status = cli_qpathinfo_basic(targetcli, targetpath, &sbuf, &attributes); @@ -4495,7 +4496,7 @@ static int cmd_show_connect( void ) return 1; } - d_printf("//%s/%s\n", cli_state_remote_name(targetcli), targetcli->share); + d_printf("//%s/%s\n", smbXcli_conn_remote_name(targetcli->conn), targetcli->share); return 0; } diff --git a/source3/include/async_smb.h b/source3/include/async_smb.h index 30c71a2..121a6ec 100644 --- a/source3/include/async_smb.h +++ b/source3/include/async_smb.h @@ -33,9 +33,6 @@ struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx, NTSTATUS cli_smb_req_send(struct tevent_req *req); size_t cli_smb_wct_ofs(struct tevent_req **reqs, int num_reqs); NTSTATUS cli_smb_chain_send(struct tevent_req **reqs, int num_reqs); -bool cli_has_async_calls(struct cli_state *cli); -void cli_smb_req_unset_pending(struct tevent_req *req); -bool cli_smb_req_set_pending(struct tevent_req *req); uint16_t cli_smb_req_mid(struct tevent_req *req); void cli_smb_req_set_mid(struct tevent_req *req, uint16_t mid); uint32_t cli_smb_req_seqnum(struct tevent_req *req); diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index ef4b9bf..048e560 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -171,7 +171,7 @@ copy an IP address from one buffer to another Return True if a server has CIFS UNIX capabilities. ********************************************************************/ -#define SERVER_HAS_UNIX_CIFS(c) (cli_state_capabilities(c) & CAP_UNIX) +#define SERVER_HAS_UNIX_CIFS(c) (smb1cli_conn_capabilities(c->conn) & CAP_UNIX) /**************************************************************************** Make a filename into unix format. diff --git a/source3/lib/netapi/cm.c b/source3/lib/netapi/cm.c index 4dfa6b5..36e8731 100644 --- a/source3/lib/netapi/cm.c +++ b/source3/lib/netapi/cm.c @@ -24,6 +24,7 @@ #include "lib/netapi/netapi_private.h" #include "libsmb/libsmb.h" #include "rpc_client/cli_pipe.h" +#include "../libcli/smb/smbXcli_base.h" /******************************************************************** ********************************************************************/ @@ -48,7 +49,7 @@ static struct client_ipc_connection *ipc_cm_find( struct client_ipc_connection *p; for (p = priv_ctx->ipc_connections; p; p = p->next) { - const char *remote_name = cli_state_remote_name(p->cli); + const char *remote_name = smbXcli_conn_remote_name(p->cli->conn); if (strequal(remote_name, server_name)) { return p; @@ -172,7 +173,7 @@ static NTSTATUS pipe_cm_find(struct client_ipc_connection *ipc, return NT_STATUS_PIPE_EMPTY; } - ipc_remote_name = cli_state_remote_name(ipc->cli); + ipc_remote_name = smbXcli_conn_remote_name(ipc->cli->conn); if (strequal(ipc_remote_name, p->pipe->desthost) && ndr_syntax_id_equal(&p->pipe->abstract_syntax, diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 1736ba6..c549b58 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -38,6 +38,7 @@ #include "../libcli/security/security.h" #include "passdb.h" #include "libsmb/libsmb.h" +#include "../libcli/smb/smbXcli_base.h" /**************************************************************** ****************************************************************/ @@ -1209,7 +1210,7 @@ NTSTATUS libnet_join_ok(const char *netbios_domain_name, DEBUG(0,("libnet_join_ok: failed to get schannel session " "key from server %s for domain %s. Error was %s\n", - cli_state_remote_name(cli), + smbXcli_conn_remote_name(cli->conn), netbios_domain_name, nt_errstr(status))); cli_shutdown(cli); return status; @@ -1231,7 +1232,7 @@ NTSTATUS libnet_join_ok(const char *netbios_domain_name, DEBUG(0,("libnet_join_ok: failed to open schannel session " "on netlogon pipe to server %s for domain %s. " "Error was %s\n", - cli_state_remote_name(cli), + smbXcli_conn_remote_name(cli->conn), netbios_domain_name, nt_errstr(status))); return status; } @@ -1977,8 +1978,8 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx, create_local_private_krb5_conf_for_domain( r->out.dns_domain_name, r->out.netbios_domain_name, - NULL, cli_state_remote_sockaddr(cli), - cli_state_remote_name(cli)); + NULL, smbXcli_conn_remote_sockaddr(cli->conn), + smbXcli_conn_remote_name(cli->conn)); if (r->out.domain_is_ad && r->in.account_ou && !(r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_UNSECURE)) { diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index 721ac9b..62aaa56 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -23,16 +23,6 @@ #include "async_smb.h" #include "../libcli/smb/smbXcli_base.h" -void cli_smb_req_unset_pending(struct tevent_req *req) -{ - smbXcli_req_unset_pending(req); -} - -bool cli_smb_req_set_pending(struct tevent_req *req) -{ - return smbXcli_req_set_pending(req); -} - /* * Fetch a smb request's mid. Only valid after the request has been sent by * cli_smb_req_send(). @@ -117,7 +107,7 @@ struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx, additional_flags |= FLAG_CASELESS_PATHNAMES; } - if ((cli_state_capabilities(cli) & CAP_DFS) && cli->dfsroot) { + if ((smb1cli_conn_capabilities(cli->conn) & CAP_DFS) && cli->dfsroot) { additional_flags2 |= FLAGS2_DFS_PATHNAMES; } @@ -180,7 +170,7 @@ struct tevent_req *cli_smb_send(TALLOC_CTX *mem_ctx, additional_flags |= FLAG_CASELESS_PATHNAMES; } - if ((cli_state_capabilities(cli) & CAP_DFS) && cli->dfsroot) { + if ((smb1cli_conn_capabilities(cli->conn) & CAP_DFS) && cli->dfsroot) { additional_flags2 |= FLAGS2_DFS_PATHNAMES; } @@ -328,8 +318,3 @@ NTSTATUS cli_smb_chain_send(struct tevent_req **reqs, int num_reqs) { return smb1cli_req_chain_submit(reqs, num_reqs); } - -bool cli_has_async_calls(struct cli_state *cli) -{ - return smbXcli_conn_has_async_calls(cli->conn); -} diff --git a/source3/libsmb/cli_np_tstream.c b/source3/libsmb/cli_np_tstream.c index 4a2b197..f7e609d 100644 --- a/source3/libsmb/cli_np_tstream.c +++ b/source3/libsmb/cli_np_tstream.c @@ -146,7 +146,7 @@ struct tevent_req *tstream_cli_np_open_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } - if (cli_state_protocol(cli) < PROTOCOL_SMB2_02) { + if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) { state->is_smb1 = true; } diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 9c1e3e1..fe8c3a1 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -108,7 +108,7 @@ static struct tevent_req *cli_session_setup_lanman2_send( uint16_t *vwv; uint8_t *bytes; char *tmp; - uint16_t sec_mode = cli_state_security_mode(cli); + uint16_t sec_mode = smb1cli_conn_server_security_mode(cli->conn); req = tevent_req_create(mem_ctx, &state, struct cli_session_setup_lanman2_state); @@ -138,7 +138,7 @@ static struct tevent_req *cli_session_setup_lanman2_send( return tevent_req_post(req, ev); } - if (!SMBencrypt(pass, cli_state_server_challenge(cli), + if (!SMBencrypt(pass, smb1cli_conn_server_challenge(cli->conn), (uint8_t *)lm_response.data)) { DEBUG(1, ("Password is > 14 chars in length, and is " "therefore incompatible with Lanman " @@ -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); @@ -181,7 +181,7 @@ static struct tevent_req *cli_session_setup_lanman2_send( SSVAL(vwv+2, 0, CLI_BUFFER_SIZE); SSVAL(vwv+3, 0, 2); SSVAL(vwv+4, 0, 1); - SIVAL(vwv+5, 0, cli_state_server_session_key(cli)); + SIVAL(vwv+5, 0, smb1cli_conn_server_session_key(cli->conn)); SSVAL(vwv+7, 0, lm_response.length); bytes = talloc_array(state, uint8_t, lm_response.length); @@ -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); @@ -314,7 +314,7 @@ static NTSTATUS cli_session_setup_lanman2(struct cli_state *cli, const char *use 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 */ @@ -346,7 +346,7 @@ static NTSTATUS cli_session_setup_lanman2(struct cli_state *cli, const char *use static uint32_t cli_session_setup_capabilities(struct cli_state *cli, uint32_t sesssetup_capabilities) { - uint32_t client_capabilities = cli_state_capabilities(cli); + uint32_t client_capabilities = smb1cli_conn_capabilities(cli->conn); /* * We only send capabilities based on the mask for: @@ -406,7 +406,7 @@ struct tevent_req *cli_session_setup_guest_create(TALLOC_CTX *mem_ctx, SSVAL(vwv+2, 0, CLI_BUFFER_SIZE); SSVAL(vwv+3, 0, 2); SSVAL(vwv+4, 0, cli_state_get_vc_num(cli)); - SIVAL(vwv+5, 0, cli_state_server_session_key(cli)); + SIVAL(vwv+5, 0, smb1cli_conn_server_session_key(cli->conn)); SSVAL(vwv+7, 0, 0); SSVAL(vwv+8, 0, 0); SSVAL(vwv+9, 0, 0); @@ -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); @@ -551,7 +551,7 @@ static NTSTATUS cli_session_setup_guest(struct cli_state *cli) 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 */ @@ -621,7 +621,7 @@ static struct tevent_req *cli_session_setup_plain_send( SSVAL(vwv+2, 0, CLI_BUFFER_SIZE); SSVAL(vwv+3, 0, 2); SSVAL(vwv+4, 0, cli_state_get_vc_num(cli)); - SIVAL(vwv+5, 0, cli_state_server_session_key(cli)); + SIVAL(vwv+5, 0, smb1cli_conn_server_session_key(cli->conn)); SSVAL(vwv+7, 0, 0); SSVAL(vwv+8, 0, 0); SSVAL(vwv+9, 0, 0); @@ -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); @@ -756,7 +756,7 @@ static NTSTATUS cli_session_setup_plain(struct cli_state *cli, 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 */ @@ -834,7 +834,7 @@ static struct tevent_req *cli_session_setup_nt1_send( DATA_BLOB names_blob; server_chal = - data_blob_const(cli_state_server_challenge(cli), + data_blob_const(smb1cli_conn_server_challenge(cli->conn), 8); /* @@ -873,7 +873,7 @@ static struct tevent_req *cli_session_setup_nt1_send( return tevent_req_post(req, ev); } - SMBNTencrypt(pass, cli_state_server_challenge(cli), + SMBNTencrypt(pass, smb1cli_conn_server_challenge(cli->conn), nt_response.data); #endif /* non encrypted password supplied. Ignore ntpass. */ @@ -885,7 +885,7 @@ static struct tevent_req *cli_session_setup_nt1_send( } if (!SMBencrypt(pass, - cli_state_server_challenge(cli), + smb1cli_conn_server_challenge(cli->conn), lm_response.data)) { /* * Oops, the LM response is @@ -963,7 +963,7 @@ static struct tevent_req *cli_session_setup_nt1_send( SSVAL(vwv+2, 0, CLI_BUFFER_SIZE); SSVAL(vwv+3, 0, 2); SSVAL(vwv+4, 0, cli_state_get_vc_num(cli)); - SIVAL(vwv+5, 0, cli_state_server_session_key(cli)); + SIVAL(vwv+5, 0, smb1cli_conn_server_session_key(cli->conn)); SSVAL(vwv+7, 0, lm_response.length); SSVAL(vwv+8, 0, nt_response.length); SSVAL(vwv+9, 0, 0); @@ -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); } @@ -1086,8 +1086,8 @@ static void cli_session_setup_nt1_done(struct tevent_req *subreq) 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; } @@ -1113,7 +1113,7 @@ static NTSTATUS cli_session_setup_nt1(struct cli_state *cli, const char *user, 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 */ @@ -1185,7 +1185,7 @@ static struct tevent_req *cli_sesssetup_blob_send(TALLOC_CTX *mem_ctx, state->blob = blob; state->cli = cli; - if (cli_state_protocol(cli) >= PROTOCOL_SMB2_02) { + if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) { usable_space = UINT16_MAX; } else { usable_space = cli_state_available_size(cli, @@ -1217,7 +1217,7 @@ static bool cli_sesssetup_blob_next(struct cli_sesssetup_blob_state *state, thistime = MIN(state->blob.length, state->max_blob_size); - if (cli_state_protocol(state->cli) >= PROTOCOL_SMB2_02) { + if (smbXcli_conn_protocol(state->cli->conn) >= PROTOCOL_SMB2_02) { state->smb2_blob.data = state->blob.data; state->smb2_blob.length = thistime; @@ -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; @@ -1298,7 +1298,7 @@ static void cli_sesssetup_blob_done(struct tevent_req *subreq) uint8_t *inbuf; ssize_t ret; - if (cli_state_protocol(state->cli) >= PROTOCOL_SMB2_02) { + if (smbXcli_conn_protocol(state->cli->conn) >= PROTOCOL_SMB2_02) { status = smb2cli_session_setup_recv(subreq, state, &state->recv_iov, &state->ret_blob); @@ -1316,7 +1316,7 @@ static void cli_sesssetup_blob_done(struct tevent_req *subreq) state->status = status; - if (cli_state_protocol(state->cli) >= PROTOCOL_SMB2_02) { + if (smbXcli_conn_protocol(state->cli->conn) >= PROTOCOL_SMB2_02) { goto next; } @@ -1481,7 +1481,7 @@ static struct tevent_req *cli_session_setup_kerberos_send( state->negTokenTarg.length); -- Samba Shared Repository