s3: Safely mark our sconn as smb2 if we have that protocol
authorVolker Lendecke <vl@samba.org>
Mon, 30 May 2011 14:30:54 +0000 (16:30 +0200)
committerVolker Lendecke <vlendec@samba.org>
Mon, 30 May 2011 20:49:53 +0000 (22:49 +0200)
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.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon May 30 22:49:53 CEST 2011 on sn-devel-104

source3/smbd/smb2_negprot.c

index f9528f823a5feb65daeb9ec3131461fd51c744fa..f639503ad4cc418d6728d5ae7937b786ddfe106a 100644 (file)
@@ -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);
 }