]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: smb_file_rename_information() doesn't need to use the wildcard status of...
authorJeremy Allison <jra@samba.org>
Tue, 29 Sep 2020 20:47:08 +0000 (13:47 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 30 Sep 2020 20:46:41 +0000 (20:46 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/trans2.c

index d76e8fc8ffbc8755cc9d8f6f4018e79257b53d5b..a02b226a55f023d3820e95736a9054d1e264d158 100644 (file)
@@ -7315,7 +7315,6 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
        char *newname = NULL;
        struct smb_filename *smb_fname_dst = NULL;
        const char *dst_original_lcomp = NULL;
-       bool dest_has_wcard = False;
        NTSTATUS status = NT_STATUS_OK;
        char *p;
        TALLOC_CTX *ctx = talloc_tos();
@@ -7333,25 +7332,23 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
        }
 
        if (req->posix_pathnames) {
-               srvstr_get_path_wcard_posix(ctx,
+               srvstr_get_path_posix(ctx,
                                pdata,
                                req->flags2,
                                &newname,
                                &pdata[12],
                                len,
                                0,
-                               &status,
-                               &dest_has_wcard);
+                               &status);
        } else {
-               srvstr_get_path_wcard(ctx,
+               srvstr_get_path(ctx,
                                pdata,
                                req->flags2,
                                &newname,
                                &pdata[12],
                                len,
                                0,
-                               &status,
-                               &dest_has_wcard);
+                               &status);
        }
        if (!NT_STATUS_IS_OK(status)) {
                return status;
@@ -7403,11 +7400,8 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
                 * the newname instead.
                 */
                char *base_name = NULL;
-               uint32_t ucf_flags = ucf_flags_from_smb_request(req);
-
-               if (dest_has_wcard) {
-                       ucf_flags |= UCF_ALWAYS_ALLOW_WCARD_LCOMP;
-               }
+               uint32_t ucf_flags = UCF_ALWAYS_ALLOW_WCARD_LCOMP|
+                               ucf_flags_from_smb_request(req);
 
                /* newname must *not* be a stream name. */
                if (newname[0] == ':') {