mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
s3: libsmb: Fix cli_resolve_path() to cope with DFS paths passed in as well as local paths.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
This commit is contained in:
parent
d9f0d92479
commit
3c2a31b438
@ -905,6 +905,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
|
||||
struct smbXcli_tcon *target_tcon = NULL;
|
||||
struct cli_dfs_path_split *dfs_refs = NULL;
|
||||
bool ok;
|
||||
bool is_already_dfs = false;
|
||||
|
||||
if ( !rootcli || !path || !targetcli ) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
@ -929,6 +930,24 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
|
||||
|
||||
*targetcli = NULL;
|
||||
|
||||
is_already_dfs = cli_dfs_is_already_full_path(rootcli, path);
|
||||
if (is_already_dfs) {
|
||||
const char *localpath = NULL;
|
||||
/*
|
||||
* Given path is already converted to DFS.
|
||||
* Convert to a local path so clean_path()
|
||||
* can correctly strip any wildcards.
|
||||
*/
|
||||
status = cli_dfs_target_check(ctx,
|
||||
rootcli,
|
||||
path,
|
||||
&localpath);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return status;
|
||||
}
|
||||
path = localpath;
|
||||
}
|
||||
|
||||
/* Send a trans2_query_path_info to check for a referral. */
|
||||
|
||||
cleanpath = clean_path(ctx, path);
|
||||
|
Loading…
Reference in New Issue
Block a user