summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-06-22 17:06:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:09:29 -0500
commit7bf085571eba5f321d35ff449d68da39ec303dab (patch)
treeb2772f64d1ce496cd8c3dd6223da43a71951ad07
parentd44c28b3a9ee09c27edb738684d79646b1e311a0 (diff)
downloadsamba-7bf085571eba5f321d35ff449d68da39ec303dab.tar.gz
samba-7bf085571eba5f321d35ff449d68da39ec303dab.tar.xz
samba-7bf085571eba5f321d35ff449d68da39ec303dab.zip
r16464: split client and server min/max protocol settings
metze (This used to be commit 6164d1e22e0545f558315591d49f862de06ea945)
-rw-r--r--source4/libcli/cliconnect.c2
-rw-r--r--source4/libcli/smb_composite/connect.c2
-rw-r--r--source4/param/loadparm.c24
-rw-r--r--source4/smb_server/smb/negprot.c4
-rw-r--r--source4/smb_server/smb_server.c2
5 files changed, 21 insertions, 13 deletions
diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c
index d89d6a15681..45f44adba13 100644
--- a/source4/libcli/cliconnect.c
+++ b/source4/libcli/cliconnect.c
@@ -57,7 +57,7 @@ BOOL smbcli_transport_establish(struct smbcli_state *cli,
/* wrapper around smb_raw_negotiate() */
NTSTATUS smbcli_negprot(struct smbcli_state *cli)
{
- return smb_raw_negotiate(cli->transport, lp_maxprotocol());
+ return smb_raw_negotiate(cli->transport, lp_cli_maxprotocol());
}
/* wrapper around smb_raw_sesssetup() */
diff --git a/source4/libcli/smb_composite/connect.c b/source4/libcli/smb_composite/connect.c
index a28d33cf7f7..7d4960d7d56 100644
--- a/source4/libcli/smb_composite/connect.c
+++ b/source4/libcli/smb_composite/connect.c
@@ -63,7 +63,7 @@ static NTSTATUS connect_send_negprot(struct composite_context *c,
{
struct connect_state *state = talloc_get_type(c->private_data, struct connect_state);
- state->req = smb_raw_negotiate_send(state->transport, lp_maxprotocol());
+ state->req = smb_raw_negotiate_send(state->transport, lp_cli_maxprotocol());
NT_STATUS_HAVE_NO_MEMORY(state->req);
state->req->async.fn = request_handler;
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 3d33da2bcd4..e76d955b5eb 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -139,8 +139,10 @@ typedef struct
int max_mux;
int max_xmit;
int pwordlevel;
- int maxprotocol;
- int minprotocol;
+ int srv_maxprotocol;
+ int srv_minprotocol;
+ int cli_maxprotocol;
+ int cli_minprotocol;
int security;
char **AuthMethods;
int paranoid_server_security;
@@ -448,8 +450,10 @@ static struct parm_struct parm_table[] = {
{"tls crlfile", P_STRING, P_GLOBAL, &Globals.tls_crlfile, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
{"swat directory", P_STRING, P_GLOBAL, &Globals.swat_directory, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
{"large readwrite", P_BOOL, P_GLOBAL, &Globals.bLargeReadwrite, NULL, NULL, FLAG_DEVELOPER},
- {"max protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, FLAG_DEVELOPER},
- {"min protocol", P_ENUM, P_GLOBAL, &Globals.minprotocol, NULL, enum_protocol, FLAG_DEVELOPER},
+ {"server max protocol", P_ENUM, P_GLOBAL, &Globals.srv_maxprotocol, NULL, enum_protocol, FLAG_DEVELOPER},
+ {"server min protocol", P_ENUM, P_GLOBAL, &Globals.srv_minprotocol, NULL, enum_protocol, FLAG_DEVELOPER},
+ {"client max protocol", P_ENUM, P_GLOBAL, &Globals.cli_maxprotocol, NULL, enum_protocol, FLAG_DEVELOPER},
+ {"client min protocol", P_ENUM, P_GLOBAL, &Globals.cli_minprotocol, NULL, enum_protocol, FLAG_DEVELOPER},
{"unicode", P_BOOL, P_GLOBAL, &Globals.bUnicode, NULL, NULL, FLAG_DEVELOPER},
{"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, FLAG_DEVELOPER},
{"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, FLAG_DEVELOPER},
@@ -647,8 +651,10 @@ static void init_globals(void)
do_parameter("max xmit", "12288", NULL);
do_parameter("password level", "0", NULL);
do_parameter("LargeReadwrite", "True", NULL);
- do_parameter("min protocol", "CORE", NULL);
- do_parameter("max protocol", "NT1", NULL);
+ do_parameter("server min protocol", "CORE", NULL);
+ do_parameter("server max protocol", "NT1", NULL);
+ do_parameter("client min protocol", "CORE", NULL);
+ do_parameter("client max protocol", "NT1", NULL);
do_parameter("security", "USER", NULL);
do_parameter("paranoid server security", "True", NULL);
do_parameter("EncryptPasswords", "True", NULL);
@@ -882,8 +888,10 @@ _PUBLIC_ FN_GLOBAL_INTEGER(lp_min_wins_ttl, &Globals.min_wins_ttl)
_PUBLIC_ FN_GLOBAL_INTEGER(lp_maxmux, &Globals.max_mux)
_PUBLIC_ FN_GLOBAL_INTEGER(lp_max_xmit, &Globals.max_xmit)
_PUBLIC_ FN_GLOBAL_INTEGER(lp_passwordlevel, &Globals.pwordlevel)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_maxprotocol, &Globals.maxprotocol)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_minprotocol, &Globals.minprotocol)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_srv_maxprotocol, &Globals.srv_maxprotocol)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_srv_minprotocol, &Globals.srv_minprotocol)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_cli_maxprotocol, &Globals.cli_maxprotocol)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_cli_minprotocol, &Globals.cli_minprotocol)
_PUBLIC_ FN_GLOBAL_INTEGER(lp_security, &Globals.security)
_PUBLIC_ FN_GLOBAL_LIST(lp_auth_methods, &Globals.AuthMethods)
_PUBLIC_ FN_GLOBAL_BOOL(lp_paranoid_server_security, &Globals.paranoid_server_security)
diff --git a/source4/smb_server/smb/negprot.c b/source4/smb_server/smb/negprot.c
index 5f1e75447b3..29e6c0736f5 100644
--- a/source4/smb_server/smb/negprot.c
+++ b/source4/smb_server/smb/negprot.c
@@ -509,8 +509,8 @@ void smbsrv_reply_negprot(struct smbsrv_request *req)
for (protocol = 0; supported_protocols[protocol].proto_name; protocol++) {
int i;
- if (supported_protocols[protocol].protocol_level > lp_maxprotocol()) continue;
- if (supported_protocols[protocol].protocol_level < lp_minprotocol()) continue;
+ if (supported_protocols[protocol].protocol_level > lp_srv_maxprotocol()) continue;
+ if (supported_protocols[protocol].protocol_level < lp_srv_minprotocol()) continue;
for (i = 0; i < protos_count; i++) {
if (strcmp(supported_protocols[protocol].proto_name, protos[i]) != 0) continue;
diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c
index ef8967f0b26..6df48f3df60 100644
--- a/source4/smb_server/smb_server.c
+++ b/source4/smb_server/smb_server.c
@@ -61,7 +61,7 @@ static NTSTATUS smbsrv_recv_generic_request(void *private, DATA_BLOB blob)
packet_set_callback(smb_conn->packet, smbsrv_recv_smb_request);
return smbsrv_recv_smb_request(smb_conn, blob);
case SMB2_MAGIC:
- if (lp_maxprotocol() < PROTOCOL_SMB2) break;
+ if (lp_srv_maxprotocol() < PROTOCOL_SMB2) break;
status = smbsrv_init_smb2_connection(smb_conn);
NT_STATUS_NOT_OK_RETURN(status);
packet_set_callback(smb_conn->packet, smbsrv_recv_smb2_request);