From 4edece5e973ac22ce735be3ca2944147d26bdb5d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 3 Sep 2018 15:28:21 +0200 Subject: [PATCH] s3:smb2_tcon: pass down in_flags to smbd_smb2_tree_connect_send() SMB 3.1.1 converted the reserved field to a flags field. Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed Feb 26 21:11:59 UTC 2020 on sn-devel-184 --- source3/smbd/smb2_tcon.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c index bf709d8686e..76112d04889 100644 --- a/source3/smbd/smb2_tcon.c +++ b/source3/smbd/smb2_tcon.c @@ -33,6 +33,7 @@ static struct tevent_req *smbd_smb2_tree_connect_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct smbd_smb2_request *smb2req, + uint16_t in_flags, const char *in_path); static NTSTATUS smbd_smb2_tree_connect_recv(struct tevent_req *req, uint8_t *out_share_type, @@ -46,7 +47,9 @@ static void smbd_smb2_request_tcon_done(struct tevent_req *subreq); NTSTATUS smbd_smb2_request_process_tcon(struct smbd_smb2_request *req) { + struct smbXsrv_connection *xconn = req->xconn; const uint8_t *inbody; + uint16_t in_flags; uint16_t in_path_offset; uint16_t in_path_length; DATA_BLOB in_path_buffer; @@ -62,6 +65,11 @@ NTSTATUS smbd_smb2_request_process_tcon(struct smbd_smb2_request *req) } inbody = SMBD_SMB2_IN_BODY_PTR(req); + if (xconn->protocol >= PROTOCOL_SMB3_11) { + in_flags = SVAL(inbody, 0x02); + } else { + in_flags = 0; + } in_path_offset = SVAL(inbody, 0x04); in_path_length = SVAL(inbody, 0x06); @@ -96,6 +104,7 @@ NTSTATUS smbd_smb2_request_process_tcon(struct smbd_smb2_request *req) subreq = smbd_smb2_tree_connect_send(req, req->sconn->ev_ctx, req, + in_flags, in_path_string); if (subreq == NULL) { return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); @@ -425,6 +434,7 @@ struct smbd_smb2_tree_connect_state { static struct tevent_req *smbd_smb2_tree_connect_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct smbd_smb2_request *smb2req, + uint16_t in_flags, const char *in_path) { struct tevent_req *req; -- 2.34.1