mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
s3: libsmb: In cli_mkdir_send() (SMBmkdir) check for DFS pathname.
smbtorture3: SMB1-DFS-OPERATIONS: test_smb1_mkdir() shows SMBmkdir uses DFS paths. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
This commit is contained in:
parent
e2efea7d1f
commit
47cf519e98
@ -2145,6 +2145,7 @@ struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
|
||||
uint8_t additional_flags = 0;
|
||||
uint16_t additional_flags2 = 0;
|
||||
uint8_t *bytes = NULL;
|
||||
char *dname_cp = NULL;
|
||||
|
||||
req = tevent_req_create(mem_ctx, &state, struct cli_mkdir_state);
|
||||
if (req == NULL) {
|
||||
@ -2164,9 +2165,19 @@ struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
/*
|
||||
* SMBmkdir on a DFS share must use DFS names.
|
||||
*/
|
||||
dname_cp = smb1_dfs_share_path(state, cli, dname);
|
||||
if (tevent_req_nomem(dname_cp, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), dname,
|
||||
strlen(dname)+1, NULL);
|
||||
bytes = smb_bytes_push_str(bytes,
|
||||
smbXcli_conn_use_unicode(cli->conn),
|
||||
dname_cp,
|
||||
strlen(dname_cp)+1,
|
||||
NULL);
|
||||
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
|
Loading…
Reference in New Issue
Block a user