s3: smbd: Fix up the ucf_flags correctly in smb_file_rename_information().
authorJeremy Allison <jra@samba.org>
Thu, 18 May 2017 20:22:36 +0000 (13:22 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 22 May 2017 16:41:16 +0000 (18:41 +0200)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
source3/smbd/trans2.c

index 8fd238ae96c92cd450aa21275e9d997b53b33a9d..5155abb00955e4d85465012a57c9550b1f5f0e73 100644 (file)
@@ -7013,6 +7013,12 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
                 * the newname instead.
                 */
                char *base_name = NULL;
+               uint32_t ucf_flags = UCF_SAVE_LCOMP |
+                       ucf_flags_from_smb_request(req);
+
+               if (dest_has_wcard) {
+                       ucf_flags |= UCF_ALWAYS_ALLOW_WCARD_LCOMP;
+               }
 
                /* newname must *not* be a stream name. */
                if (newname[0] == ':') {
@@ -7045,10 +7051,7 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
                }
 
                status = unix_convert(ctx, conn, base_name, &smb_fname_dst,
-                                     (UCF_SAVE_LCOMP |
-                                         (dest_has_wcard ?
-                                             UCF_ALWAYS_ALLOW_WCARD_LCOMP :
-                                             0)));
+                                       ucf_flags);
 
                /* If an error we expect this to be
                 * NT_STATUS_OBJECT_PATH_NOT_FOUND */