*pp_smb_fname = NULL;
- status = resolve_dfspath_wcard(ctx, conn,
- dfs_path,
+ if (dfs_path) {
+ status = resolve_dfspath_wcard(ctx, conn,
name_in,
ucf_flags,
!conn->sconn->using_smb2,
&fname,
ppath_contains_wcard);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(10,("filename_convert_internal: resolve_dfspath failed "
- "for name %s with %s\n",
- name_in,
- nt_errstr(status) ));
- return status;
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(10,("filename_convert_internal: resolve_dfspath "
+ "failed for name %s with %s\n",
+ name_in,
+ nt_errstr(status) ));
+ return status;
+ }
+ } else {
+ fname = discard_const_p(char, name_in);
}
if (is_fake_file_path(name_in)) {
NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx,
connection_struct *conn,
- bool dfs_pathnames,
const char *name_in,
uint32_t ucf_flags,
bool allow_broken_path,
char **pp_name_out,
bool *ppath_contains_wcard)
{
- bool path_contains_wcard;
+ bool path_contains_wcard = false;
NTSTATUS status = NT_STATUS_OK;
- if (dfs_pathnames) {
- status = dfs_redirect(ctx,
- conn,
- name_in,
- ucf_flags,
- allow_broken_path,
- pp_name_out,
- &path_contains_wcard);
-
- if (NT_STATUS_IS_OK(status) && ppath_contains_wcard != NULL) {
- *ppath_contains_wcard = path_contains_wcard;
- }
- } else {
- /*
- * Cheat and just return a copy of the in ptr.
- * Once srvstr_get_path() uses talloc it'll
- * be a talloced ptr anyway.
- */
- *pp_name_out = discard_const_p(char, name_in);
+ status = dfs_redirect(ctx,
+ conn,
+ name_in,
+ ucf_flags,
+ allow_broken_path,
+ pp_name_out,
+ &path_contains_wcard);
+
+ if (NT_STATUS_IS_OK(status) &&
+ ppath_contains_wcard != NULL &&
+ path_contains_wcard) {
+ *ppath_contains_wcard = path_contains_wcard;
}
return status;
}
struct junction_map *enum_msdfs_links(TALLOC_CTX *ctx, size_t *p_num_jn);
NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx,
connection_struct *conn,
- bool dfs_pathnames,
const char *name_in,
uint32_t ucf_flags,
bool allow_broken_path,
DEBUG(10,("smb_file_rename_information: got name |%s|\n",
newname));
- status = resolve_dfspath_wcard(ctx, conn,
- req->flags2 & FLAGS2_DFS_PATHNAMES,
+ if (req->flags2 & FLAGS2_DFS_PATHNAMES) {
+ status = resolve_dfspath_wcard(ctx, conn,
newname,
UCF_COND_ALLOW_WCARD_LCOMP,
!conn->sconn->using_smb2,
&newname,
&dest_has_wcard);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
}
/* Check the new name has no '/' characters. */