1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

smbd: Do an early exit on negprot failure

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12610

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2017-02-28 15:03:45 +00:00 committed by Jeremy Allison
parent 1e0c79ddb3
commit cf9acf9a3d

View File

@ -723,16 +723,25 @@ void reply_negprot(struct smb_request *req)
break;
}
if(choice != -1) {
if (choice == -1) {
bool ok;
DBG_NOTICE("No protocol supported !\n");
reply_outbuf(req, 1, 0);
SSVAL(req->outbuf, smb_vwv0, choice);
ok = srv_send_smb(xconn, (char *)req->outbuf,
false, 0, false, NULL);
if (!ok) {
DBG_NOTICE("srv_send_smb failed\n");
}
exit_server_cleanly("no protocol supported\n");
}
fstrcpy(remote_proto,supported_protocols[protocol].short_name);
reload_services(sconn, conn_snum_used, true);
supported_protocols[protocol].proto_reply_fn(req, choice);
DEBUG(3,("Selected protocol %s\n",supported_protocols[protocol].proto_name));
} else {
DBG_NOTICE("No protocol supported !\n");
reply_outbuf(req, 1, 0);
SSVAL(req->outbuf, smb_vwv0, choice);
}
DEBUG( 5, ( "negprot index=%d\n", choice ) );