1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3: libsmb: In cli_qpathinfo_send() (SMBtrans2:TRANSACT2_QPATHINFO) check for DFS pathname.

See smbtorture3: SMB1-DFS-PATHS: test_smb1_qpathinfo()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
This commit is contained in:
Jeremy Allison 2022-09-09 09:40:12 -07:00
parent adc4a1b290
commit fa7e6899b3

View File

@ -6577,6 +6577,7 @@ struct tevent_req *cli_qpathinfo_send(TALLOC_CTX *mem_ctx,
struct tevent_req *req, *subreq;
struct cli_qpathinfo_state *state;
uint16_t additional_flags2 = 0;
char *fname_cp = NULL;
req = tevent_req_create(mem_ctx, &state, struct cli_qpathinfo_state);
if (req == NULL) {
@ -6590,8 +6591,18 @@ struct tevent_req *cli_qpathinfo_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
SSVAL(state->param, 0, level);
state->param = trans2_bytes_push_str(
state->param, smbXcli_conn_use_unicode(cli->conn), fname, strlen(fname)+1, NULL);
/*
* qpathinfo on a DFS share must use DFS names.
*/
fname_cp = smb1_dfs_share_path(state, cli, fname);
if (tevent_req_nomem(fname_cp, req)) {
return tevent_req_post(req, ev);
}
state->param = trans2_bytes_push_str(state->param,
smbXcli_conn_use_unicode(cli->conn),
fname_cp,
strlen(fname_cp)+1,
NULL);
if (tevent_req_nomem(state->param, req)) {
return tevent_req_post(req, ev);
}