[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Mar 31 12:57:12 MDT 2010


The branch, master has been updated
       via  eb60833... Fix bug 7310 - DOS attribute inconsistency with MS Office
       via  2e839a6... Merge branch 'master' of ssh://git.samba.org/data/git/samba
       via  f58d02d... Second part of fix for bug #6494 - Incorrect FileStatus returned in NT_CREATE_ANDX.
      from  6f30b9a... s3:smbd: handle SMB2 in deadtime_fn() and avoid disconnecting non idle clients

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit eb60833a45d0d21463d6101953136e1f3e3de380
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Mar 30 22:16:37 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

commit 2e839a636b2ea3f4d8dfcf5a8e99d9725787ba61
Merge: f58d02dbeeeba037ee79fba93a707e959e90ffa3 6f30b9a6ff57ca6112e6319c64c411d2bf09be79
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Mar 31 10:01:03 2010 -0700

    Merge branch 'master' of ssh://git.samba.org/data/git/samba

commit f58d02dbeeeba037ee79fba93a707e959e90ffa3
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Mar 30 16:54:43 2010 -0700

    Second part of fix for bug #6494 - Incorrect FileStatus returned in NT_CREATE_ANDX.
    
    Ensure we do this in nttrans create too.
    
    Jeremy.

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

Summary of changes:
 source3/smbd/nttrans.c |   20 +++++++++++++++++++-
 source3/smbd/reply.c   |   15 +++++++++++++++
 2 files changed, 34 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 93621dd..b79bb0b 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -1220,7 +1220,25 @@ static void call_nt_transact_create(connection_struct *conn,
 	SOFF_T(p,0,file_len);
 	p += 8;
 	if (flags & EXTENDED_RESPONSE_REQUIRED) {
-		SSVAL(p,2,0x7);
+		uint16_t file_status = (NO_EAS|NO_SUBSTREAMS|NO_REPARSETAG);
+		size_t num_names = 0;
+		unsigned int num_streams;
+		struct stream_struct *streams = NULL;
+
+		/* Do we have any EA's ? */
+		status = get_ea_names_from_file(ctx, conn, fsp,
+				smb_fname->base_name, NULL, &num_names);
+		if (NT_STATUS_IS_OK(status) && num_names) {
+			file_status &= ~NO_EAS;
+		}
+		status = SMB_VFS_STREAMINFO(conn, NULL, smb_fname->base_name, ctx,
+			&num_streams, &streams);
+		/* There is always one stream, ::$DATA. */
+		if (NT_STATUS_IS_OK(status) && num_streams > 1) {
+			file_status &= ~NO_SUBSTREAMS;
+		}
+		TALLOC_FREE(streams);
+		SSVAL(p,2,file_status);
 	}
 	p += 4;
 	SCVAL(p,0,fsp->is_directory ? 1 : 0);
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index fdcf487..c34e7f8 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);
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list