summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2019-11-26 12:53:09 -0800
committerKarolin Seeger <kseeger@samba.org>2019-12-16 08:22:36 +0000
commit2757c0711d02c2135afb161dac70d2150b18190b (patch)
tree79e39e320b8a8cd43152679a9f2e639940f2f0d5 /source3
parentd8d661aabfdb04b8a472b85e6cc3fba0dd490c23 (diff)
downloadsamba-2757c0711d02c2135afb161dac70d2150b18190b.tar.gz
s3: smbd: Only set xconn->smb1.negprot.done = true after supported_protocols[protocol].proto_reply_fn() succeeds.
Otherwise we can end up with negprot.done set, but without smbXsrv_connection_init_tables() being called. This can cause a client self-crash. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14205 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Dec 4 21:27:24 UTC 2019 on sn-devel-184 (cherry picked from commit 8db0c1bff6f42feabd2e4d9dfb13ae12cc29607b)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/negprot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 8317dc49086..e77c8f52261 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -588,7 +588,6 @@ void reply_negprot(struct smb_request *req)
END_PROFILE(SMBnegprot);
exit_server_cleanly("multiple negprot's are not permitted");
}
- xconn->smb1.negprot.done = true;
if (req->buflen == 0) {
DEBUG(0, ("negprot got no protocols\n"));
@@ -778,6 +777,8 @@ void reply_negprot(struct smb_request *req)
DBG_INFO("negprot index=%zu\n", choice);
+ xconn->smb1.negprot.done = true;
+
/* We always have xconn->smb1.signing_state also for >= SMB2_02 */
signing_required = smb_signing_is_mandatory(xconn->smb1.signing_state);
if (signing_required && (chosen_level < PROTOCOL_NT1)) {