提交 9bf67e51 编写于 作者: J Jeff Layton 提交者: Steve French

cifs: save the dialect chosen by server

Signed-off-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 ad6cca6d
...@@ -185,6 +185,7 @@ struct TCP_Server_Info { ...@@ -185,6 +185,7 @@ struct TCP_Server_Info {
struct mac_key mac_signing_key; struct mac_key mac_signing_key;
char ntlmv2_hash[16]; char ntlmv2_hash[16];
unsigned long lstrp; /* when we got last response from this server */ unsigned long lstrp; /* when we got last response from this server */
u16 dialect; /* dialect index that server chose */
}; };
/* /*
......
...@@ -355,7 +355,6 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) ...@@ -355,7 +355,6 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
struct TCP_Server_Info *server; struct TCP_Server_Info *server;
u16 count; u16 count;
unsigned int secFlags; unsigned int secFlags;
u16 dialect;
if (ses->server) if (ses->server)
server = ses->server; server = ses->server;
...@@ -408,10 +407,10 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) ...@@ -408,10 +407,10 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
if (rc != 0) if (rc != 0)
goto neg_err_exit; goto neg_err_exit;
dialect = le16_to_cpu(pSMBr->DialectIndex); server->dialect = le16_to_cpu(pSMBr->DialectIndex);
cFYI(1, "Dialect: %d", dialect); cFYI(1, "Dialect: %d", server->dialect);
/* Check wct = 1 error case */ /* Check wct = 1 error case */
if ((pSMBr->hdr.WordCount < 13) || (dialect == BAD_PROT)) { if ((pSMBr->hdr.WordCount < 13) || (server->dialect == BAD_PROT)) {
/* core returns wct = 1, but we do not ask for core - otherwise /* core returns wct = 1, but we do not ask for core - otherwise
small wct just comes when dialect index is -1 indicating we small wct just comes when dialect index is -1 indicating we
could not negotiate a common dialect */ could not negotiate a common dialect */
...@@ -419,8 +418,8 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) ...@@ -419,8 +418,8 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
goto neg_err_exit; goto neg_err_exit;
#ifdef CONFIG_CIFS_WEAK_PW_HASH #ifdef CONFIG_CIFS_WEAK_PW_HASH
} else if ((pSMBr->hdr.WordCount == 13) } else if ((pSMBr->hdr.WordCount == 13)
&& ((dialect == LANMAN_PROT) && ((server->dialect == LANMAN_PROT)
|| (dialect == LANMAN2_PROT))) { || (server->dialect == LANMAN2_PROT))) {
__s16 tmp; __s16 tmp;
struct lanman_neg_rsp *rsp = (struct lanman_neg_rsp *)pSMBr; struct lanman_neg_rsp *rsp = (struct lanman_neg_rsp *)pSMBr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册