1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

s3: libsmb: In cli_getatr_send() (SMBgetatr) check for DFS pathname.

smbtorture3: SMB1-DFS-OPERATIONS: test_smb1_getatr() shows
SMBgetatr uses DFS paths.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
This commit is contained in:
Jeremy Allison 2022-09-08 09:50:56 -07:00
parent b58cee4251
commit 75339aec0e

View File

@ -4373,6 +4373,7 @@ struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
uint8_t additional_flags = 0;
uint16_t additional_flags2 = 0;
uint8_t *bytes = NULL;
char *fname_cp = NULL;
req = tevent_req_create(mem_ctx, &state, struct cli_getatr_state);
if (req == NULL) {
@ -4385,9 +4386,19 @@ struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
if (tevent_req_nomem(bytes, req)) {
return tevent_req_post(req, ev);
}
/*
* SMBgetatr 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);
}
bytes[0] = 4;
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), fname,
strlen(fname)+1, NULL);
bytes = smb_bytes_push_str(bytes,
smbXcli_conn_use_unicode(cli->conn),
fname_cp,
strlen(fname_cp)+1,
NULL);
if (tevent_req_nomem(bytes, req)) {
return tevent_req_post(req, ev);