summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-03-30 22:16:37 -0700
committerKarolin Seeger <kseeger@samba.org>2010-04-01 09:39:19 +0200
commit42e88dbf2a53ba4cc4edd1576bfc1fe6308fa22c (patch)
tree84954d1524fc604bc57b6490d433382fe111339f
parent506caa5b9132b6fd20121ac47695be7bada89a2d (diff)
downloadsamba-42e88dbf2a53ba4cc4edd1576bfc1fe6308fa22c.tar.gz
Fix bug 7310 - DOS attribute inconsistency with MS Office
On rename we need to set the archive bit on the renamed file. Jeremy (cherry picked from commit 779c2052b3b13c8f1a793e59e6152c3704eb75c6)
-rw-r--r--source3/smbd/reply.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 8d40ed6c572..c9c80e81b86 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -5846,6 +5846,21 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
"%s -> %s\n", smb_fname_str_dbg(fsp->fsp_name),
smb_fname_str_dbg(smb_fname_dst)));
+ if (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_STAT(conn, smb_fname_dst) == 0) {
+ uint32_t old_dosmode = dos_mode(conn,
+ smb_fname_dst);
+ file_set_dosmode(conn,
+ smb_fname_dst,
+ old_dosmode | FILE_ATTRIBUTE_ARCHIVE,
+ NULL,
+ true);
+ }
+ }
+
notify_rename(conn, fsp->is_directory, fsp->fsp_name,
smb_fname_dst);