]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: use filename_convert() in smb_file_rename_information()
authorRalph Boehme <slow@samba.org>
Thu, 26 Mar 2020 13:49:33 +0000 (14:49 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 27 Mar 2020 01:06:30 +0000 (01:06 +0000)
Replaces direct calls to resolve_dfspath_wcard() and filename_convert(). On the
way to consolidate all callers of pathname processing onto filename_convert().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/trans2.c

index 5b7333773bbb523e32379c524ca9df8ba1ad8de9..73510d8ae46e64bbe323e9c65c758faa3fb6b5d0 100644 (file)
@@ -7326,18 +7326,6 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
        DEBUG(10,("smb_file_rename_information: got name |%s|\n",
                                newname));
 
-       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;
-               }
-       }
-
        /* Check the new name has no '/' characters. */
        if (strchr_m(newname, '/')) {
                return NT_STATUS_NOT_SUPPORTED;
@@ -7415,8 +7403,13 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
                        return NT_STATUS_NO_MEMORY;
                }
 
-               status = unix_convert(ctx, conn, base_name, &smb_fname_dst,
-                                       ucf_flags);
+               status = filename_convert(ctx,
+                                         conn,
+                                         base_name,
+                                         ucf_flags,
+                                         NULL,
+                                         NULL,
+                                         &smb_fname_dst);
 
                /* If an error we expect this to be
                 * NT_STATUS_OBJECT_PATH_NOT_FOUND */