--- a/source/libsmb/cliconnect.c 2009-09-30 14:24:50.000000000 +0200 +++ b/source/libsmb/cliconnect.c 2016-04-14 22:42:06.000000000 +0200 @@ -1058,6 +1058,16 @@ } else { NTSTATUS status; + if (lp_use_spnego()) { + /* + * Don't send an NTLMv2 response without NTLMSSP + * if we want to use spnego support + */ + DEBUG(1, ("Server does not support EXTENDED_SECURITY " + "but spnego is turned on\n")); + return NT_STATUS_ACCESS_DENIED; + } + /* otherwise do a NT1 style session setup */ status = cli_session_setup_nt1(cli, user, pass, passlen, ntpass, ntpasslen, workgroup);