[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-268-g7ca59ff

Tim Prouty tprouty at samba.org
Wed Jul 8 04:15:27 GMT 2009


The branch, master has been updated
       via  7ca59ffe5a6608ac865e6fe403b17638af09595a (commit)
       via  0d9b2048823870363db1856b8f5113f35aeb6a08 (commit)
      from  9aebdc25010548c00d64b02f827c80a6e8fee9bf (commit)

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


- Log -----------------------------------------------------------------
commit 7ca59ffe5a6608ac865e6fe403b17638af09595a
Author: Tim Prouty <tprouty at samba.org>
Date:   Tue Jul 7 17:56:49 2009 -0700

    s3: Migrate a few functions in open.c to take smb_filename

commit 0d9b2048823870363db1856b8f5113f35aeb6a08
Author: Tim Prouty <tprouty at samba.org>
Date:   Tue Jul 7 17:27:50 2009 -0700

    s3: Remove unnecessary const qualifiers

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

Summary of changes:
 source3/include/proto.h   |    9 ++++-----
 source3/locking/locking.c |    3 +--
 source3/smbd/dosmode.c    |    5 ++---
 source3/smbd/open.c       |   28 +++++++++++++++-------------
 4 files changed, 22 insertions(+), 23 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index fb10dd2..0315f30 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -3474,8 +3474,7 @@ NTSTATUS can_set_delete_on_close(files_struct *fsp, bool delete_on_close,
 void set_delete_on_close_token(struct share_mode_lock *lck, const UNIX_USER_TOKEN *tok);
 void set_delete_on_close_lck(struct share_mode_lock *lck, bool delete_on_close, const UNIX_USER_TOKEN *tok);
 bool set_delete_on_close(files_struct *fsp, bool delete_on_close, const UNIX_USER_TOKEN *tok);
-bool set_sticky_write_time(const struct file_id fileid,
-			   struct timespec write_time);
+bool set_sticky_write_time(struct file_id fileid, struct timespec write_time);
 bool set_write_time(struct file_id fileid, struct timespec write_time);
 int share_mode_forall(void (*fn)(const struct share_mode_entry *, const char *,
 				 const char *, void *),
@@ -6243,9 +6242,9 @@ int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname,
 		     uint32 dosmode, const char *parent_dir, bool newfile);
 int file_ntimes(connection_struct *conn, const struct smb_filename *smb_fname,
 		struct smb_file_time *ft);
-bool set_sticky_write_time_path(struct file_id fileid,
-				const struct timespec mtime);
-bool set_sticky_write_time_fsp(struct files_struct *fsp, const struct timespec mtime);
+bool set_sticky_write_time_path(struct file_id fileid, struct timespec mtime);
+bool set_sticky_write_time_fsp(struct files_struct *fsp,
+			       struct timespec mtime);
 bool update_write_time(struct files_struct *fsp);
 
 /* The following definitions come from smbd/error.c  */
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 78064cf..dd735be 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -1415,8 +1415,7 @@ bool set_delete_on_close(files_struct *fsp, bool delete_on_close, const UNIX_USE
 	return True;
 }
 
-bool set_sticky_write_time(const struct file_id fileid,
-			   struct timespec write_time)
+bool set_sticky_write_time(struct file_id fileid, struct timespec write_time)
 {
 	struct share_mode_lock *lck;
 
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 76034db..9d44eee 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -781,8 +781,7 @@ int file_ntimes(connection_struct *conn, const struct smb_filename *smb_fname,
  returned on all future write time queries and set on close.
 ******************************************************************/
 
-bool set_sticky_write_time_path(const struct file_id fileid,
-				const struct timespec mtime)
+bool set_sticky_write_time_path(struct file_id fileid, struct timespec mtime)
 {
 	if (null_timespec(mtime)) {
 		return true;
@@ -800,7 +799,7 @@ bool set_sticky_write_time_path(const struct file_id fileid,
  returned on all future write time queries and set on close.
 ******************************************************************/
 
-bool set_sticky_write_time_fsp(struct files_struct *fsp, const struct timespec mtime)
+bool set_sticky_write_time_fsp(struct files_struct *fsp, struct timespec mtime)
 {
 	fsp->write_time_forced = true;
 	TALLOC_FREE(fsp->update_write_time_event);
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 926c0ec..e93485b 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -65,7 +65,7 @@ NTSTATUS smb1_file_se_access_check(const struct security_descriptor *sd,
 ****************************************************************************/
 
 static NTSTATUS check_open_rights(struct connection_struct *conn,
-				const char *fname,
+				const struct smb_filename *smb_fname,
 				uint32_t access_mask,
 				uint32_t *access_granted)
 {
@@ -84,7 +84,7 @@ static NTSTATUS check_open_rights(struct connection_struct *conn,
 		return NT_STATUS_OK;
 	}
 
-	status = SMB_VFS_GET_NT_ACL(conn, fname,
+	status = SMB_VFS_GET_NT_ACL(conn, smb_fname->base_name,
 			(OWNER_SECURITY_INFORMATION |
 			GROUP_SECURITY_INFORMATION |
 			DACL_SECURITY_INFORMATION),&sd);
@@ -92,7 +92,7 @@ static NTSTATUS check_open_rights(struct connection_struct *conn,
 	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(10, ("check_open_rights: Could not get acl "
 			"on %s: %s\n",
-			fname,
+			smb_fname_str_dbg(smb_fname),
 			nt_errstr(status)));
 		return status;
 	}
@@ -106,7 +106,7 @@ static NTSTATUS check_open_rights(struct connection_struct *conn,
 
 	DEBUG(10,("check_open_rights: file %s requesting "
 		"0x%x returning 0x%x (%s)\n",
-		fname,
+		smb_fname_str_dbg(smb_fname),
 		(unsigned int)access_mask,
 		(unsigned int)*access_granted,
 		nt_errstr(status) ));
@@ -482,7 +482,7 @@ static NTSTATUS open_file(files_struct *fsp,
 			uint32_t access_granted = 0;
 
 			status = check_open_rights(conn,
-					path,
+					smb_fname,
 					access_mask,
 					&access_granted);
 			if (!NT_STATUS_IS_OK(status)) {
@@ -1374,7 +1374,7 @@ static void schedule_defer_open(struct share_mode_lock *lck,
 ****************************************************************************/
 
 static NTSTATUS calculate_access_mask(connection_struct *conn,
-					const char *fname,
+					const struct smb_filename *smb_fname,
 					bool file_existed,
 					uint32_t access_mask,
 					uint32_t *access_mask_out)
@@ -1394,7 +1394,7 @@ static NTSTATUS calculate_access_mask(connection_struct *conn,
 			struct security_descriptor *sd;
 			uint32_t access_granted = 0;
 
-			status = SMB_VFS_GET_NT_ACL(conn, fname,
+			status = SMB_VFS_GET_NT_ACL(conn, smb_fname->base_name,
 					(OWNER_SECURITY_INFORMATION |
 					GROUP_SECURITY_INFORMATION |
 					DACL_SECURITY_INFORMATION),&sd);
@@ -1402,7 +1402,7 @@ static NTSTATUS calculate_access_mask(connection_struct *conn,
 			if (!NT_STATUS_IS_OK(status)) {
 				DEBUG(10, ("calculate_access_mask: Could not get acl "
 					"on file %s: %s\n",
-					fname,
+					smb_fname_str_dbg(smb_fname),
 					nt_errstr(status)));
 				return NT_STATUS_ACCESS_DENIED;
 			}
@@ -1417,7 +1417,7 @@ static NTSTATUS calculate_access_mask(connection_struct *conn,
 			if (!NT_STATUS_IS_OK(status)) {
 				DEBUG(10, ("calculate_access_mask: Access denied on "
 					"file %s: when calculating maximum access\n",
-					fname));
+					smb_fname_str_dbg(smb_fname)));
 				return NT_STATUS_ACCESS_DENIED;
 			}
 
@@ -1688,7 +1688,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
 		}
 	}
 
-	status = calculate_access_mask(conn, fname, file_existed,
+	status = calculate_access_mask(conn, smb_fname, file_existed,
 					access_mask,
 					&access_mask); 
 	if (!NT_STATUS_IS_OK(status)) {
@@ -2447,6 +2447,8 @@ static NTSTATUS open_directory(connection_struct *conn,
 	struct timespec mtimespec;
 	int info = 0;
 
+	SMB_ASSERT(!is_ntfs_stream_smb_fname(smb_dname));
+
 	DEBUG(5,("open_directory: opening directory %s, access_mask = 0x%x, "
 		 "share_access = 0x%x create_options = 0x%x, "
 		 "create_disposition = 0x%x, file_attributes = 0x%x\n",
@@ -2465,7 +2467,7 @@ static NTSTATUS open_directory(connection_struct *conn,
 		return NT_STATUS_NOT_A_DIRECTORY;
 	}
 
-	status = calculate_access_mask(conn, smb_dname->base_name, dir_existed,
+	status = calculate_access_mask(conn, smb_dname, dir_existed,
 				       access_mask, &access_mask);
 	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(10, ("open_directory: calculate_access_mask "
@@ -2557,8 +2559,8 @@ static NTSTATUS open_directory(connection_struct *conn,
 
 	if (info == FILE_WAS_OPENED) {
 		uint32_t access_granted = 0;
-		status = check_open_rights(conn, smb_dname->base_name,
-					   access_mask, &access_granted);
+		status = check_open_rights(conn, smb_dname, access_mask,
+					   &access_granted);
 
 		/* Were we trying to do a directory open
 		 * for delete and didn't get DELETE


-- 
Samba Shared Repository


More information about the samba-cvs mailing list