The branch, v3-4-test has been updated
       via  d502902... Fix bug 7310 - DOS attribute inconsistency with MS Office
      from  41c5ab5... Fix bug 7307 - man net usershare mistake

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-4-test


- Log -----------------------------------------------------------------
commit d5029023e1a44e1bfcbd4e5822d937fa03ba5a1b
Author: Jeremy Allison <[email protected]>
Date:   Tue Mar 30 22:24:19 2010 -0700

    Fix bug 7310 - DOS attribute inconsistency with MS Office
    
    On rename we need to set the archive bit on the renamed file.
    
    Jeremy

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/reply.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 23fa3e8..2dd4bad 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -5815,6 +5815,23 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
                DEBUG(3,("rename_internals_fsp: succeeded doing rename on %s -> 
%s\n",
                        fsp->fsp_name,newname));
 
+               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,newname,&sbuf1) == 0) {
+                               uint32_t old_dosmode = dos_mode(conn,
+                                                       newname,
+                                                       &sbuf1);
+                               file_set_dosmode(conn,
+                                       newname,
+                                       old_dosmode | FILE_ATTRIBUTE_ARCHIVE,
+                                       &sbuf1,
+                                       NULL,
+                                       true);
+                       }
+               }
+
                notify_rename(conn, fsp->is_directory, fsp->fsp_name, newname);
 
                rename_open_files(conn, lck, newname);


-- 
Samba Shared Repository

Reply via email to