Bug #11659

Updated by Andrew Stormont almost 3 years ago

No response is emitted when a NEGOTIATE request is received with dialects that are unsupported.    This appears to be due to the fact that the response header is not properly initialised.    The code also attempts to respond with NT_STATUS_INVALID_PARAMETER: 
 best_version = smb2_find_best_dialect(s, cl_versions, version_cnt); 
 if (best_version == 0) { 
	 cmn_err(CE_NOTE, "clnt %s no supported dialect", 
	 sr->smb2_status = NT_STATUS_INVALID_PARAMETER; 
	 rc = -1; 
	 goto errout; 
 Whereas send NT_STATUS_INVALID_PARAMETER whereas the correct response is NT_STATUS_NOT_SUPPORTED: 

 >The server MUST select the greatest common dialect between the dialects it implements and the Dialects array of the SMB2 NEGOTIATE request. If a common dialect is not found, the server MUST fail the request with STATUS_NOT_SUPPORTED. 

 NT_STATUS_NOT_SUPPORTED.    We also do not properly handle the cases where no dialect is given and drop the connection when we should leave it open.