summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorLuk Claes <luk@debian.org>2012-05-19 18:09:30 +0200
committerStefan Metzmacher <metze@samba.org>2012-05-28 14:49:45 +0200
commitd8c0646a5db34a390ceeb853e50c2d098b992c85 (patch)
tree486749c41d524ffa61c50adae19f1b1d2352f525 /source3
parent4f6f4ea93c83fa5154f450e2e43649467e4c2b32 (diff)
downloadsamba-d8c0646a5db34a390ceeb853e50c2d098b992c85.tar.gz
samba-d8c0646a5db34a390ceeb853e50c2d098b992c85.tar.bz2
samba-d8c0646a5db34a390ceeb853e50c2d098b992c85.zip
s3:libsmb: get rid of cli_state_protocol
Signed-off-by: Luk Claes <luk@debian.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c2
-rw-r--r--source3/libsmb/cli_np_tstream.c2
-rw-r--r--source3/libsmb/cliconnect.c28
-rw-r--r--source3/libsmb/clidfs.c4
-rw-r--r--source3/libsmb/clientgen.c5
-rw-r--r--source3/libsmb/clilist.c2
-rw-r--r--source3/libsmb/proto.h1
-rw-r--r--source3/rpc_server/spoolss/srv_spoolss_nt.c3
-rw-r--r--source3/torture/masktest.c3
-rw-r--r--source3/utils/net_rpc.c2
-rw-r--r--source3/winbindd/winbindd_cm.c4
11 files changed, 26 insertions, 30 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index f3ba63fde3..42c5efc3a0 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -428,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);
diff --git a/source3/libsmb/cli_np_tstream.c b/source3/libsmb/cli_np_tstream.c
index 4a2b1976d2..f7e609d200 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 63acc925ad..f61665b253 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -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;
@@ -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);
#endif
- if (cli_state_protocol(cli) >= PROTOCOL_SMB2_02) {
+ if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
state->cli->smb2.session = smbXcli_session_create(cli,
cli->conn);
if (tevent_req_nomem(state->cli->smb2.session, req)) {
@@ -1517,7 +1517,7 @@ static void cli_session_setup_kerberos_done(struct tevent_req *subreq)
cli_set_session_key(state->cli, state->session_key_krb5);
- if (cli_state_protocol(state->cli) >= PROTOCOL_SMB2_02) {
+ if (smbXcli_conn_protocol(state->cli->conn) >= PROTOCOL_SMB2_02) {
struct smbXcli_session *session = state->cli->smb2.session;
status = smb2cli_session_set_session_key(session,
state->session_key_krb5,
@@ -1659,7 +1659,7 @@ static struct tevent_req *cli_session_setup_ntlmssp_send(
state->blob_out = spnego_gen_negTokenInit(state, OIDs_ntlm, &blob_out, NULL);
data_blob_free(&blob_out);
- if (cli_state_protocol(cli) >= PROTOCOL_SMB2_02) {
+ if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
state->cli->smb2.session = smbXcli_session_create(cli,
cli->conn);
if (tevent_req_nomem(state->cli->smb2.session, req)) {
@@ -1708,7 +1708,7 @@ static void cli_session_setup_ntlmssp_done(struct tevent_req *subreq)
cli_set_session_key(
state->cli, state->ntlmssp_state->session_key);
- if (cli_state_protocol(state->cli) >= PROTOCOL_SMB2_02) {
+ if (smbXcli_conn_protocol(state->cli->conn) >= PROTOCOL_SMB2_02) {
struct smbXcli_session *session = state->cli->smb2.session;
if (ntlmssp_is_anonymous(state->ntlmssp_state)) {
@@ -2041,7 +2041,7 @@ NTSTATUS cli_session_setup(struct cli_state *cli,
workgroup = user2;
}
- if (cli_state_protocol(cli) < PROTOCOL_LANMAN1) {
+ if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_LANMAN1) {
return NT_STATUS_OK;
}
@@ -2051,7 +2051,7 @@ NTSTATUS cli_session_setup(struct cli_state *cli,
/* if its an older server then we have to use the older request format */
- if (cli_state_protocol(cli) < PROTOCOL_NT1) {
+ if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_NT1) {
if (!lp_client_lanman_auth() && passlen != 24 && (*pass)) {
DEBUG(1, ("Server requested LM password but 'client lanman auth = no'"
" or 'client ntlmv2 auth = yes'\n"));
@@ -2069,7 +2069,7 @@ NTSTATUS cli_session_setup(struct cli_state *cli,
workgroup);
}
- if (cli_state_protocol(cli) >= PROTOCOL_SMB2_02) {
+ if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
const char *remote_realm = cli_state_remote_realm(cli);
ADS_STATUS status = cli_session_setup_spnego(cli, user, pass,
workgroup,
@@ -2447,7 +2447,7 @@ static void cli_tcon_andx_done(struct tevent_req *subreq)
}
}
- if ((cli_state_protocol(cli) >= PROTOCOL_NT1) && (num_bytes == 3)) {
+ if ((smbXcli_conn_protocol(cli->conn) >= PROTOCOL_NT1) && (num_bytes == 3)) {
/* almost certainly win95 - enable bug fixes */
cli->win95 = True;
}
@@ -2459,7 +2459,7 @@ static void cli_tcon_andx_done(struct tevent_req *subreq)
cli->dfsroot = false;
- if ((wct > 2) && (cli_state_protocol(cli) >= PROTOCOL_LANMAN2)) {
+ if ((wct > 2) && (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_LANMAN2)) {
cli->dfsroot = ((SVAL(vwv+2, 0) & SMB_SHARE_IN_DFS) != 0);
}
@@ -2519,7 +2519,7 @@ NTSTATUS cli_tree_connect(struct cli_state *cli, const char *share,
return NT_STATUS_NO_MEMORY;
}
- if (cli_state_protocol(cli) >= PROTOCOL_SMB2_02) {
+ if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
return smb2cli_tcon(cli, share);
}
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 2c1539c39d..97b6ec0d48 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -865,7 +865,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
dfs_auth_info,
false,
cli_state_encryption_on(rootcli),
- cli_state_protocol(rootcli),
+ smbXcli_conn_protocol(rootcli->conn),
0,
0x20,
&cli_ipc);
@@ -916,7 +916,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
dfs_auth_info,
false,
cli_state_encryption_on(rootcli),
- cli_state_protocol(rootcli),
+ smbXcli_conn_protocol(rootcli->conn),
0,
0x20,
targetcli);
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index cd68f558ff..6f81ddde2d 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -435,11 +435,6 @@ bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive)
return ret;
}
-enum protocol_types cli_state_protocol(struct cli_state *cli)
-{
- return smbXcli_conn_protocol(cli->conn);
-}
-
uint32_t cli_state_capabilities(struct cli_state *cli)
{
return smb1cli_conn_capabilities(cli->conn);
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index ce36a4b2e7..103d044f56 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -879,7 +879,7 @@ struct tevent_req *cli_list_send(TALLOC_CTX *mem_ctx,
return NULL;
}
- if (cli_state_protocol(cli) <= PROTOCOL_LANMAN1) {
+ if (smbXcli_conn_protocol(cli->conn) <= PROTOCOL_LANMAN1) {
subreq = cli_list_old_send(state, ev, cli, mask, attribute);
state->recv_fn = cli_list_old_recv;
} else {
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 652e0caf8c..de69be2919 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -182,7 +182,6 @@ uint16_t cli_state_set_tid(struct cli_state *cli, uint16_t tid);
uint16_t cli_state_get_uid(struct cli_state *cli);
uint16_t cli_state_set_uid(struct cli_state *cli, uint16_t uid);
bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
-enum protocol_types cli_state_protocol(struct cli_state *cli);
uint32_t cli_state_capabilities(struct cli_state *cli);
uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs);
uint16_t cli_state_max_requests(struct cli_state *cli);
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index 3a6fc35793..2b0387dd49 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -55,6 +55,7 @@
#include "printing/printer_list.h"
#include "../lib/tsocket/tsocket.h"
#include "rpc_client/cli_winreg_spoolss.h"
+#include "../libcli/smb/smbXcli_base.h"
/* macros stolen from s4 spoolss server */
#define SPOOLSS_BUFFER_UNION(fn,info,level) \
@@ -2499,7 +2500,7 @@ static bool spoolss_connect_to_client(struct rpc_pipe_client **pp_pipe,
return false;
}
- if ( cli_state_protocol(the_cli) != PROTOCOL_NT1 ) {
+ if ( smbXcli_conn_protocol(the_cli->conn) != PROTOCOL_NT1 ) {
DEBUG(0,("spoolss_connect_to_client: machine %s didn't negotiate NT protocol.\n", remote_machine));
cli_shutdown(the_cli);
return false;
diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c
index 29569fada6..6669949635 100644
--- a/source3/torture/masktest.c
+++ b/source3/torture/masktest.c
@@ -22,6 +22,7 @@
#include "trans2.h"
#include "libsmb/libsmb.h"
#include "libsmb/nmblib.h"
+#include "../libcli/smb/smbXcli_base.h"
static fstring password;
static fstring username;
@@ -144,7 +145,7 @@ static bool reg_match_one(struct cli_state *cli, const char *pattern, const char
if (strcmp(file,"..") == 0) file = ".";
- return ms_fnmatch(pattern, file, cli_state_protocol(cli), False) == 0;
+ return ms_fnmatch(pattern, file, smbXcli_conn_protocol(cli->conn), False) == 0;
}
static char *reg_test(struct cli_state *cli, const char *pattern, const char *long_name, const char *short_name)
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 37f088dae8..daae7f449e 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -7108,7 +7108,7 @@ bool net_rpc_check(struct net_context *c, unsigned flags)
status = cli_negprot(cli, PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(status))
goto done;
- if (cli_state_protocol(cli) < PROTOCOL_NT1)
+ if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_NT1)
goto done;
ret = true;
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index c515ace347..41795dd1af 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -834,10 +834,10 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain,
goto done;
}
- if (cli_state_protocol(*cli) >= PROTOCOL_NT1 &&
+ if (smbXcli_conn_protocol((*cli)->conn) >= PROTOCOL_NT1 &&
cli_state_capabilities(*cli) & CAP_EXTENDED_SECURITY) {
try_spnego = true;
- } else if (cli_state_protocol(*cli) >= PROTOCOL_SMB2_02) {
+ } else if (smbXcli_conn_protocol((*cli)->conn) >= PROTOCOL_SMB2_02) {
try_spnego = true;
}