]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: remove a nested block in non_widelink_open()
authorRalph Boehme <slow@samba.org>
Thu, 2 Jul 2020 06:02:45 +0000 (08:02 +0200)
committerJeremy Allison <jra@samba.org>
Sat, 18 Jul 2020 05:58:41 +0000 (05:58 +0000)
No change in behaviour.

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

index 21d611e1818f9d2bee3f7f1ea227157ac189a5c6..767d3fefddb3889fefa357d249ea3c9996038199 100644 (file)
@@ -628,6 +628,7 @@ static int non_widelink_open(files_struct *fsp,
        struct connection_struct *conn = fsp->conn;
        NTSTATUS status;
        int fd = -1;
+       struct smb_filename *tmp_fsp_name = fsp->fsp_name;
        struct smb_filename *smb_fname_rel = NULL;
        int saved_errno = 0;
        struct smb_filename *oldwd_fname = NULL;
@@ -690,20 +691,16 @@ static int non_widelink_open(files_struct *fsp,
 
        flags |= O_NOFOLLOW;
 
-       {
-               struct smb_filename *tmp_name = fsp->fsp_name;
-
-               fsp->fsp_name = smb_fname_rel;
+       fsp->fsp_name = smb_fname_rel;
 
-               fd = SMB_VFS_OPENAT(conn,
-                                   cwdfsp,
-                                   smb_fname_rel,
-                                   fsp,
-                                   flags,
-                                   mode);
+       fd = SMB_VFS_OPENAT(conn,
+                           cwdfsp,
+                           smb_fname_rel,
+                           fsp,
+                           flags,
+                           mode);
 
-               fsp->fsp_name = tmp_name;
-       }
+       fsp->fsp_name = tmp_fsp_name;
 
        if (fd == -1) {
                saved_errno = link_errno_convert(errno);