>From 1c071bdc2ca31249cf8175e789ecde3474149ba1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 30 May 2011 16:30:54 +0200 Subject: [PATCH] s3: Safely mark our sconn as smb2 if we have that protocol Otherwise smbd will crash at an unclean exit. Without this conn_close_all will do a close_cnum() on all connection_struct's. In smb2, those are talloc children of the smbd_smb2_tcon's. sconn is talloc_free'ed after the conn_close_all, but the smbd_smb2_tcon destructor will still reference tcon->compat_conn, referencing then free'ed (and null'ed out) memory. --- source3/smbd/smb2_negprot.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/source3/smbd/smb2_negprot.c b/source3/smbd/smb2_negprot.c index f9528f8..f639503 100644 --- a/source3/smbd/smb2_negprot.c +++ b/source3/smbd/smb2_negprot.c @@ -177,5 +177,7 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req) outdyn = security_buffer; + req->sconn->using_smb2 = true; + return smbd_smb2_request_done(req, outbody, &outdyn); } -- 1.7.0.4