summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-04-15 06:56:01 +0000
committerAndrew Tridgell <tridge@samba.org>2002-04-15 06:56:01 +0000
commitb5c61023ff666dcdfda59ebb0bd80fe42837d482 (patch)
tree2733c94de97770ff1cc809f0f3b434ac4047c082 /source3
parentf6929068a19ef65fad5928982fd4ac4434e1763e (diff)
downloadsamba-b5c61023ff666dcdfda59ebb0bd80fe42837d482.tar.gz
samba-b5c61023ff666dcdfda59ebb0bd80fe42837d482.tar.bz2
samba-b5c61023ff666dcdfda59ebb0bd80fe42837d482.zip
better handling of DOS LANMAN2.1 protocol
(This used to be commit 7f923d738b94eef042b21e4d0143861755620d91)
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/cliconnect.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 8ddd116679..4ed2aae1f3 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -34,6 +34,7 @@ prots[] =
{PROTOCOL_LANMAN1,"MICROSOFT NETWORKS 3.0"},
{PROTOCOL_LANMAN1,"LANMAN1.0"},
{PROTOCOL_LANMAN2,"LM1.2X002"},
+ {PROTOCOL_LANMAN2,"DOS LANMAN2.1"},
{PROTOCOL_LANMAN2,"Samba"},
{PROTOCOL_NT1,"NT LANMAN 1.0"},
{PROTOCOL_NT1,"NT LM 0.12"},
@@ -45,7 +46,7 @@ prots[] =
do an old lanman2 style session setup
****************************************************************************/
static BOOL cli_session_setup_lanman2(struct cli_state *cli, char *user,
- char *pass, int passlen)
+ char *pass, int passlen, const char *workgroup)
{
fstring pword;
char *p;
@@ -88,7 +89,10 @@ static BOOL cli_session_setup_lanman2(struct cli_state *cli, char *user,
p = smb_buf(cli->outbuf);
memcpy(p,pword,passlen);
p += passlen;
- p += clistr_push(cli, p, user, -1, STR_TERMINATE);
+ p += clistr_push(cli, p, user, -1, STR_TERMINATE|STR_UPPER);
+ p += clistr_push(cli, p, workgroup, -1, STR_TERMINATE|STR_UPPER);
+ p += clistr_push(cli, p, "Unix", -1, STR_TERMINATE);
+ p += clistr_push(cli, p, "Samba", -1, STR_TERMINATE);
cli_setup_bcc(cli, p);
cli_send_smb(cli);
@@ -591,7 +595,7 @@ BOOL cli_session_setup(struct cli_state *cli,
/* if its an older server then we have to use the older request format */
if (cli->protocol < PROTOCOL_NT1) {
- return cli_session_setup_lanman2(cli, user, pass, passlen);
+ return cli_session_setup_lanman2(cli, user, pass, passlen, workgroup);
}
/* if no user is supplied then we have to do an anonymous connection.
@@ -756,6 +760,10 @@ void cli_negprot_send(struct cli_state *cli)
char *p;
int numprots;
+ if (cli->protocol < PROTOCOL_NT1) {
+ cli->use_spnego = False;
+ }
+
memset(cli->outbuf,'\0',smb_size);
/* setup the protocol strings */
@@ -788,6 +796,10 @@ BOOL cli_negprot(struct cli_state *cli)
int numprots;
int plength;
+ if (cli->protocol < PROTOCOL_NT1) {
+ cli->use_spnego = False;
+ }
+
memset(cli->outbuf,'\0',smb_size);
/* setup the protocol strings */
@@ -822,7 +834,7 @@ BOOL cli_negprot(struct cli_state *cli)
return(False);
}
- cli->protocol = prots[SVAL(cli->inbuf,smb_vwv0)].prot;
+ cli->protocol = prots[SVAL(cli->inbuf,smb_vwv0)].prot;
if (cli->protocol >= PROTOCOL_NT1) {
/* NT protocol */
@@ -848,6 +860,7 @@ BOOL cli_negprot(struct cli_state *cli)
smb_buflen(cli->inbuf)-8, STR_UNICODE|STR_NOALIGN);
}
} else if (cli->protocol >= PROTOCOL_LANMAN1) {
+ cli->use_spnego = False;
cli->sec_mode = SVAL(cli->inbuf,smb_vwv1);
cli->max_xmit = SVAL(cli->inbuf,smb_vwv2);
cli->sesskey = IVAL(cli->inbuf,smb_vwv6);
@@ -860,6 +873,7 @@ BOOL cli_negprot(struct cli_state *cli)
cli->secblob = data_blob(smb_buf(cli->inbuf),smb_buflen(cli->inbuf));
} else {
/* the old core protocol */
+ cli->use_spnego = False;
cli->sec_mode = 0;
cli->serverzone = TimeDiff(time(NULL));
}