From: Ralph Boehme Date: Fri, 30 Oct 2020 15:06:38 +0000 (+0100) Subject: smbd: README.Coding fixes in rename_internals_fsp() X-Git-Tag: samba-4.14.0rc1~278 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=58e103a79161aa4320e6ce64528dbd2669f5ac3b;p=thirdparty%2Fsamba.git smbd: README.Coding fixes in rename_internals_fsp() No change in behaviour. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index ec6e4dfaa04..d35982118b9 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -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,