]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: README.Coding fixes in rename_internals_fsp()
authorRalph Boehme <slow@samba.org>
Fri, 30 Oct 2020 15:06:38 +0000 (16:06 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:32 +0000 (09:08 +0000)
No change in behaviour.

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

index ec6e4dfaa043c1750e9f414ab6aefc1d0080660e..d35982118b9a076a272f9d9309b6a3344ce2e217 100644 (file)
@@ -7818,14 +7818,18 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
                if (!fsp->fsp_flags.is_directory &&
                    !(fsp->posix_flags & FSP_POSIX_FLAGS_PATHNAMES) &&
                    (lp_map_archive(SNUM(conn)) ||
-                   lp_store_dos_attributes(SNUM(conn)))) {
-                       /* We must set the archive bit on the newly
-                          renamed file. */
-                       if (SMB_VFS_FSTAT(fsp, &smb_fname_dst->st) == 0) {
-                               uint32_t old_dosmode = dos_mode(conn,
-                                                       smb_fname_dst);
+                   lp_store_dos_attributes(SNUM(conn))))
+               {
+                       /*
+                        * We must set the archive bit on the newly renamed
+                        * file.
+                        */
+                       ret = SMB_VFS_FSTAT(fsp, &smb_fname_dst->st);
+                       if (ret == 0) {
+                               uint32_t old_dosmode;
 
                                fsp->fsp_name->st = smb_fname_dst->st;
+                               old_dosmode = dos_mode(conn, smb_fname_dst);
 
                                file_set_dosmode(conn,
                                        smb_fname_dst,