summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-03-30 22:16:37 -0700
committerJeremy Allison <jra@samba.org>2010-03-31 10:10:52 -0700
commiteb60833a45d0d21463d6101953136e1f3e3de380 (patch)
tree57e449830f25e52e2dbb2917ee07d534f9b4bc4f
parent2e839a636b2ea3f4d8dfcf5a8e99d9725787ba61 (diff)
downloadsamba-eb60833a45d0d21463d6101953136e1f3e3de380.tar.gz
samba-eb60833a45d0d21463d6101953136e1f3e3de380.tar.bz2
samba-eb60833a45d0d21463d6101953136e1f3e3de380.zip
Fix bug 7310 - DOS attribute inconsistency with MS Office
On rename we need to set the archive bit on the renamed file. Jeremy
-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 fdcf4870e8..c34e7f8b06 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -5905,6 +5905,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);