[SCM] Samba Shared Repository - branch master updated

Uri Simchoni uri at samba.org
Tue Mar 15 10:46:03 UTC 2016


The branch, master has been updated
       via  e64ab0d s3: vfs: vfs_xattr_tdb - cleanup. Remove unneeded variable "path".
       via  6b87710 s3:vfs: Change get_acl_blob() to take a const smb_filename * parameter from const char *.
       via  13dae2b s3:smbd: Change refuse_symlink() to take a const smb_filename * parameter from const char *.
       via  e7898c6 s3:smbd: Change get_ea_names_from_file() to take a const smb_filename * parameter from const char *.
       via  4404cff s3:smbd: Change get_ea_list_from_file_path() to take a const smb_filename * parameter from const char *.
       via  641ebf0 s3: smbd: Change canonicalize_ea_name() to take a const smb_filename * parameter from const char *.
       via  c3937f5 s3: smbd: Reformatting - remove unneeded const char *fname variable.
       via  e800092 s3:vfs: vfs_streams_xattr.c: Change walk_xattr_streams() to const struct smb_filename * from const char *.
       via  347d3aa s3:vfs: vfs_streams_xattr.c - Remove duplicate code. This is exactly vfs_stat_smb_basename().
       via  b10d3c6 s3: vfs: vfs_solarisacl. refuse_symlink() means we can always use STAT here.
       via  f690c1c s3: vfs: vfs_hpuxacl. refuse_symlink() means we can always use STAT here.
      from  7b431eb build: mark explicit dependencies on pytalloc-util

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


- Log -----------------------------------------------------------------
commit e64ab0d72a92f5e80e7a115f168b4d24b2fe73f6
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 11 16:07:20 2016 -0800

    s3: vfs: vfs_xattr_tdb - cleanup. Remove unneeded variable "path".
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    
    Autobuild-User(master): Uri Simchoni <uri at samba.org>
    Autobuild-Date(master): Tue Mar 15 11:45:19 CET 2016 on sn-devel-144

commit 6b877102dbd7d375fdd240904f983e1f2196a100
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 11 15:50:57 2016 -0800

    s3:vfs: Change get_acl_blob() to take a const smb_filename * parameter from const char *.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>

commit 13dae2b46ed9a53b7eeed4ce125478b5bbb3e2b5
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 11 15:38:28 2016 -0800

    s3:smbd: Change refuse_symlink() to take a const smb_filename * parameter from const char *.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>

commit e7898c6d6cf433fad031179f60223555602ae48e
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 11 15:34:58 2016 -0800

    s3:smbd: Change get_ea_names_from_file() to take a const smb_filename * parameter from const char *.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>

commit 4404cff57ad22fc706b5f3b021bc5842c85b6c96
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 11 15:30:00 2016 -0800

    s3:smbd: Change get_ea_list_from_file_path() to take a const smb_filename * parameter from const char *.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>

commit 641ebf05f1b6f9d5e801c4f46ae607ef81b91c18
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 11 15:25:54 2016 -0800

    s3: smbd: Change canonicalize_ea_name() to take a const smb_filename * parameter from const char *.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>

commit c3937f556d090dc5daeb21a363f7f06154678d7a
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 11 15:23:23 2016 -0800

    s3: smbd: Reformatting - remove unneeded const char *fname variable.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>

commit e8000923aec54903e4b592be2bc4a67d71ee4064
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 11 15:11:20 2016 -0800

    s3:vfs: vfs_streams_xattr.c: Change walk_xattr_streams() to const struct smb_filename * from const char *.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>

commit 347d3aaf961774c3d90ac1e9b1ffd56fa6913118
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 11 15:08:26 2016 -0800

    s3:vfs: vfs_streams_xattr.c - Remove duplicate code. This is exactly vfs_stat_smb_basename().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>

commit b10d3c644002e30ad1c76d21b8bdcb7dc8c0e5f2
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 11 16:01:31 2016 -0800

    s3: vfs: vfs_solarisacl. refuse_symlink() means we can always use STAT here.
    
    For a posix acl call on a symlink, we've already refused it.
    For a Windows acl mapped call on a symlink, we want to follow
    it.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>

commit f690c1cfc8a53bd8c9b3e7e8fc6122d09ed7aa36
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 11 14:29:20 2016 -0800

    s3: vfs: vfs_hpuxacl. refuse_symlink() means we can always use STAT here.
    
    For a posix acl call on a symlink, we've already refused it.
    For a Windows acl mapped call on a symlink, we want to follow
    it.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>

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

Summary of changes:
 source3/modules/vfs_acl_common.c    |  48 ++++++++---------
 source3/modules/vfs_acl_tdb.c       |   8 +--
 source3/modules/vfs_acl_xattr.c     |   4 +-
 source3/modules/vfs_hpuxacl.c       |  22 ++++----
 source3/modules/vfs_solarisacl.c    |  16 ++++--
 source3/modules/vfs_streams_xattr.c |  54 +++++++++----------
 source3/modules/vfs_xattr_tdb.c     |   5 +-
 source3/smbd/nttrans.c              |   4 +-
 source3/smbd/proto.h                |   9 ++--
 source3/smbd/trans2.c               | 102 +++++++++++++++++++++++++-----------
 10 files changed, 163 insertions(+), 109 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index ba93e7b..c8c0650 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -33,7 +33,7 @@ static NTSTATUS create_acl_blob(const struct security_descriptor *psd,
 static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
 			vfs_handle_struct *handle,
 			files_struct *fsp,
-			const char *name,
+			const struct smb_filename *smb_fname,
 			DATA_BLOB *pblob);
 
 static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle,
@@ -366,7 +366,7 @@ static NTSTATUS add_directory_inheritable_components(vfs_handle_struct *handle,
 
 static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 				    files_struct *fsp,
-				    const struct smb_filename *smb_fname,
+				    const struct smb_filename *smb_fname_in,
 				    uint32_t security_info,
 				    TALLOC_CTX *mem_ctx,
 				    struct security_descriptor **ppdesc)
@@ -381,22 +381,22 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 	uint8_t sys_acl_hash_tmp[XATTR_SD_HASH_SIZE];
 	struct security_descriptor *psd = NULL;
 	struct security_descriptor *pdesc_next = NULL;
-	const char *name = NULL;
+	const struct smb_filename *smb_fname = NULL;
 	bool ignore_file_system_acl = lp_parm_bool(SNUM(handle->conn),
 						ACL_MODULE_NAME,
 						"ignore system acls",
 						false);
 	TALLOC_CTX *frame = talloc_stackframe();
 
-	if (fsp && smb_fname == NULL) {
-		name = fsp->fsp_name->base_name;
+	if (fsp && smb_fname_in == NULL) {
+		smb_fname = fsp->fsp_name;
 	} else {
-		name = smb_fname->base_name;
+		smb_fname = smb_fname_in;
 	}
 
-	DEBUG(10, ("get_nt_acl_internal: name=%s\n", name));
+	DEBUG(10, ("get_nt_acl_internal: name=%s\n", smb_fname->base_name));
 
-	status = get_acl_blob(frame, handle, fsp, name, &blob);
+	status = get_acl_blob(frame, handle, fsp, smb_fname, &blob);
 	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(10, ("get_nt_acl_internal: get_acl_blob returned %s\n",
 			nt_errstr(status)));
@@ -440,7 +440,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 		DEBUG(10, ("get_nt_acl_internal: ACL blob revision "
 			   "mismatch (%u) for file %s\n",
 			   (unsigned int)hash_type,
-			   name));
+			   smb_fname->base_name));
 		TALLOC_FREE(psd);
 		psd = NULL;
 		goto out;
@@ -451,7 +451,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 		DEBUG(10, ("get_nt_acl_internal: ACL blob hash type "
 			   "(%u) unexpected for file %s\n",
 			   (unsigned int)hash_type,
-			   name));
+			   smb_fname->base_name));
 		TALLOC_FREE(psd);
 		psd = NULL;
 		goto out;
@@ -474,10 +474,10 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 		} else {
 			/* Get the full underlying sd, then hash. */
 			ret = SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle,
-								 name,
-								 frame,
-								 &sys_acl_blob_description,
-								 &sys_acl_blob);
+						 smb_fname->base_name,
+						 frame,
+						 &sys_acl_blob_description,
+						 &sys_acl_blob);
 		}
 
 		/* If we fail to get the ACL blob (for some reason) then this
@@ -494,7 +494,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 				/* Hash matches, return blob sd. */
 				DEBUG(10, ("get_nt_acl_internal: blob hash "
 					   "matches for file %s\n",
-					   name ));
+					   smb_fname->base_name ));
 				goto out;
 			}
 		}
@@ -521,7 +521,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 		if (!NT_STATUS_IS_OK(status)) {
 			DEBUG(10, ("get_nt_acl_internal: get_next_acl for file %s "
 				   "returned %s\n",
-				   name,
+				   smb_fname->base_name,
 				   nt_errstr(status)));
 			TALLOC_FREE(frame);
 			return status;
@@ -545,7 +545,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 			/* Hash matches, return blob sd. */
 			DEBUG(10, ("get_nt_acl_internal: blob hash "
 				   "matches for file %s\n",
-				   name ));
+				   smb_fname->base_name ));
 			goto out;
 		}
 
@@ -553,11 +553,11 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 		DEBUG(10, ("get_nt_acl_internal: blob hash "
 			   "does not match for file %s - returning "
 			   "file system SD mapping.\n",
-			   name ));
+			   smb_fname->base_name ));
 
 		if (DEBUGLEVEL >= 10) {
 			DEBUG(10,("get_nt_acl_internal: acl for blob hash for %s is:\n",
-				  name ));
+				  smb_fname->base_name ));
 			NDR_PRINT_DEBUG(security_descriptor, pdesc_next);
 		}
 
@@ -587,7 +587,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 		if (!NT_STATUS_IS_OK(status)) {
 			DEBUG(10, ("get_nt_acl_internal: get_next_acl for file %s "
 				   "returned %s\n",
-				   name,
+				   smb_fname->base_name,
 				   nt_errstr(status)));
 			TALLOC_FREE(frame);
 			return status;
@@ -641,7 +641,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 			 * is fully plumbed through the VFS.
 			 */
 			int ret = vfs_stat_smb_basename(handle->conn,
-						name,
+						smb_fname->base_name,
 						&sbuf);
 			if (ret == -1) {
 				TALLOC_FREE(frame);
@@ -653,7 +653,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 		if (ignore_file_system_acl) {
 			TALLOC_FREE(pdesc_next);
 			status = make_default_filesystem_acl(mem_ctx,
-						name,
+						smb_fname->base_name,
 						psbuf,
 						&psd);
 			if (!NT_STATUS_IS_OK(status)) {
@@ -666,7 +666,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 							true)) {
 				status = add_directory_inheritable_components(
 							handle,
-							name,
+							smb_fname->base_name,
 							psbuf,
 							psd);
 				if (!NT_STATUS_IS_OK(status)) {
@@ -701,7 +701,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
 
 	if (DEBUGLEVEL >= 10) {
 		DEBUG(10,("get_nt_acl_internal: returning acl for %s is:\n",
-			name ));
+			smb_fname->base_name ));
 		NDR_PRINT_DEBUG(security_descriptor, psd);
 	}
 
diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c
index 54edb87..1bc5973 100644
--- a/source3/modules/vfs_acl_tdb.c
+++ b/source3/modules/vfs_acl_tdb.c
@@ -143,7 +143,7 @@ static NTSTATUS acl_tdb_delete(vfs_handle_struct *handle,
 static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
 			vfs_handle_struct *handle,
 			files_struct *fsp,
-			const char *name,
+			const struct smb_filename *smb_fname,
 			DATA_BLOB *pblob)
 {
 	uint8_t id_buf[16];
@@ -159,7 +159,9 @@ static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
 		status = vfs_stat_fsp(fsp);
 		sbuf = fsp->fsp_name->st;
 	} else {
-		int ret = vfs_stat_smb_basename(handle->conn, name, &sbuf);
+		int ret = vfs_stat_smb_basename(handle->conn,
+				smb_fname->base_name,
+				&sbuf);
 		if (ret == -1) {
 			status = map_nt_error_from_unix(errno);
 		}
@@ -186,7 +188,7 @@ static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
 	pblob->length = data.dsize;
 
 	DEBUG(10,("get_acl_blob: returned %u bytes from file %s\n",
-		(unsigned int)data.dsize, name ));
+		(unsigned int)data.dsize, smb_fname->base_name ));
 
 	if (pblob->length == 0 || pblob->data == NULL) {
 		return NT_STATUS_NOT_FOUND;
diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c
index 2338798..d311c57 100644
--- a/source3/modules/vfs_acl_xattr.c
+++ b/source3/modules/vfs_acl_xattr.c
@@ -40,7 +40,7 @@
 static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
 			vfs_handle_struct *handle,
 			files_struct *fsp,
-			const char *name,
+			const struct smb_filename *smb_fname,
 			DATA_BLOB *pblob)
 {
 	size_t size = 1024;
@@ -64,7 +64,7 @@ static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
 	if (fsp && fsp->fh->fd != -1) {
 		sizeret = SMB_VFS_FGETXATTR(fsp, XATTR_NTACL_NAME, val, size);
 	} else {
-		sizeret = SMB_VFS_GETXATTR(handle->conn, name,
+		sizeret = SMB_VFS_GETXATTR(handle->conn, smb_fname->base_name,
 					XATTR_NTACL_NAME, val, size);
 	}
 	if (sizeret == -1) {
diff --git a/source3/modules/vfs_hpuxacl.c b/source3/modules/vfs_hpuxacl.c
index 1894146..55a6894 100644
--- a/source3/modules/vfs_hpuxacl.c
+++ b/source3/modules/vfs_hpuxacl.c
@@ -249,22 +249,24 @@ int hpuxacl_sys_acl_set_file(vfs_handle_struct *handle,
 	}
 
 	/*
-	 * if the file is a directory, there is extra work to do:
-	 * since the hpux acl call stores both the access acl and 
-	 * the default acl as provided, we have to get the acl part 
-	 * that has _not_ been specified in "type" from the file first 
-	 * and concatenate it with the acl provided.
+	 * We can directly use SMB_VFS_STAT here, as if this was a
+	 * POSIX call on a symlink, we've already refused it.
+	 * For a Windows acl mapped call on a symlink, we want to follow
+	 * it.
 	 */
-	if (lp_posix_pathnames()) {
-		ret = SMB_VFS_LSTAT(handle->conn, smb_fname);
-	} else {
-		ret = SMB_VFS_STAT(handle->conn, smb_fname);
-	}
+	ret = SMB_VFS_STAT(handle->conn, smb_fname);
 	if (ret != 0) {
 		DEBUG(10, ("Error in stat call: %s\n", strerror(errno)));
 		goto done;
 	}
 	if (S_ISDIR(smb_fname->st.st_ex_mode)) {
+		/*
+		 * if the file is a directory, there is extra work to do:
+		 * since the hpux acl call stores both the access acl and
+		 * the default acl as provided, we have to get the acl part
+		 * that has _not_ been specified in "type" from the file first
+		 * and concatenate it with the acl provided.
+		 */
 		HPUX_ACL_T other_acl; 
 		int other_count;
 		SMB_ACL_TYPE_T other_type;
diff --git a/source3/modules/vfs_solarisacl.c b/source3/modules/vfs_solarisacl.c
index cf25abc..b421016 100644
--- a/source3/modules/vfs_solarisacl.c
+++ b/source3/modules/vfs_solarisacl.c
@@ -139,10 +139,12 @@ int solarisacl_sys_acl_set_file(vfs_handle_struct *handle,
 				SMB_ACL_T theacl)
 {
 	int ret = -1;
-	struct stat_ex s;
 	SOLARIS_ACL_T solaris_acl = NULL;
 	int count;
-	
+	struct smb_filename smb_fname = {
+		.base_name = discard_const_p(char, name)
+	};
+
 	DEBUG(10, ("solarisacl_sys_acl_set_file called for file '%s'\n",
 		   name));
 
@@ -166,12 +168,18 @@ int solarisacl_sys_acl_set_file(vfs_handle_struct *handle,
 	 * the default acl as provided, we have to get the acl part 
 	 * that has not been specified in "type" from the file first 
 	 * and concatenate it with the acl provided.
+	 *
+	 * We can directly use SMB_VFS_STAT here, as if this was a
+	 * POSIX call on a symlink, we've already refused it.
+	 * For a Windows acl mapped call on a symlink, we want to follow
+	 * it.
 	 */
-	if (vfs_stat_smb_basename(handle->conn, name, &s) != 0) {
+	ret = SMB_VFS_STAT(conn, &smb_fname);
+	if (ret != 0) {
 		DEBUG(10, ("Error in stat call: %s\n", strerror(errno)));
 		goto done;
 	}
-	if (S_ISDIR(s.st_ex_mode)) {
+	if (S_ISDIR(smb_fname.st.st_ex_mode)) {
 		SOLARIS_ACL_T other_acl = NULL;
 		int other_count;
 		SMB_ACL_TYPE_T other_type;
diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c
index 3887d9f..0d54734 100644
--- a/source3/modules/vfs_streams_xattr.c
+++ b/source3/modules/vfs_streams_xattr.c
@@ -683,11 +683,12 @@ static int streams_xattr_rename(vfs_handle_struct *handle,
 	return ret;
 }
 
-static NTSTATUS walk_xattr_streams(vfs_handle_struct *handle, files_struct *fsp,
-				   const char *fname,
-				   bool (*fn)(struct ea_struct *ea,
-					      void *private_data),
-				   void *private_data)
+static NTSTATUS walk_xattr_streams(vfs_handle_struct *handle,
+				files_struct *fsp,
+				const struct smb_filename *smb_fname,
+				bool (*fn)(struct ea_struct *ea,
+					void *private_data),
+				void *private_data)
 {
 	NTSTATUS status;
 	char **names;
@@ -697,8 +698,12 @@ static NTSTATUS walk_xattr_streams(vfs_handle_struct *handle, files_struct *fsp,
 	SMB_VFS_HANDLE_GET_DATA(handle, config, struct streams_xattr_config,
 				return NT_STATUS_UNSUCCESSFUL);
 
-	status = get_ea_names_from_file(talloc_tos(), handle->conn, fsp, fname,
-					&names, &num_names);
+	status = get_ea_names_from_file(talloc_tos(),
+				handle->conn,
+				fsp,
+				smb_fname,
+				&names,
+				&num_names);
 	if (!NT_STATUS_IS_OK(status)) {
 		return status;
 	}
@@ -729,11 +734,17 @@ static NTSTATUS walk_xattr_streams(vfs_handle_struct *handle, files_struct *fsp,
 			continue;
 		}
 
-		status = get_ea_value(names, handle->conn, fsp, fname,
-				      names[i], &ea);
+		status = get_ea_value(names,
+					handle->conn,
+					fsp,
+					smb_fname->base_name,
+					names[i],
+					&ea);
 		if (!NT_STATUS_IS_OK(status)) {
 			DEBUG(10, ("Could not get ea %s for file %s: %s\n",
-				   names[i], fname, nt_errstr(status)));
+				names[i],
+				smb_fname->base_name,
+				nt_errstr(status)));
 			continue;
 		}
 
@@ -823,23 +834,10 @@ static NTSTATUS streams_xattr_streaminfo(vfs_handle_struct *handle,
 
 	if ((fsp != NULL) && (fsp->fh->fd != -1)) {
 		ret = SMB_VFS_FSTAT(fsp, &sbuf);
-	}
-	else {
-		struct smb_filename *smb_fname_base = NULL;
-		smb_fname_base = synthetic_smb_fname(talloc_tos(),
-					smb_fname->base_name,
-					NULL,
-					NULL);
-		if (smb_fname_base == NULL) {
-			return NT_STATUS_NO_MEMORY;
-		}
-		if (lp_posix_pathnames()) {
-			ret = SMB_VFS_LSTAT(handle->conn, smb_fname_base);
-		} else {
-			ret = SMB_VFS_STAT(handle->conn, smb_fname_base);
-		}
-		sbuf = smb_fname_base->st;
-		TALLOC_FREE(smb_fname_base);
+	} else {
+		ret = vfs_stat_smb_basename(handle->conn,
+				smb_fname->base_name,
+				&sbuf);
 	}
 
 	if (ret == -1) {
@@ -862,7 +860,7 @@ static NTSTATUS streams_xattr_streaminfo(vfs_handle_struct *handle,
 		 */
 		status = NT_STATUS_OK;
 	} else {
-		status = walk_xattr_streams(handle, fsp, smb_fname->base_name,
+		status = walk_xattr_streams(handle, fsp, smb_fname,
 				    collect_one_stream, &state);
 	}
 
diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c
index 9bb4dc8..a22192b 100644
--- a/source3/modules/vfs_xattr_tdb.c
+++ b/source3/modules/vfs_xattr_tdb.c
@@ -407,7 +407,6 @@ static int xattr_tdb_rmdir(vfs_handle_struct *handle,
 	struct file_id id;
 	struct db_context *db;
 	int ret;
-	const char *path = smb_fname->base_name;
 	TALLOC_CTX *frame = talloc_stackframe();
 
 	SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context,
@@ -416,7 +415,9 @@ static int xattr_tdb_rmdir(vfs_handle_struct *handle,
 					TALLOC_FREE(frame); return -1;
 				});
 
-	if (vfs_stat_smb_basename(handle->conn, path, &sbuf) == -1) {
+	if (vfs_stat_smb_basename(handle->conn,
+				smb_fname->base_name,
+				&sbuf) == -1) {
 		TALLOC_FREE(frame);
 		return -1;
 	}
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index b1917fe..0951280 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -694,7 +694,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
 
 		/* Do we have any EA's ? */
 		status = get_ea_names_from_file(ctx, conn, fsp,
-				smb_fname->base_name, NULL, &num_names);
+				smb_fname, NULL, &num_names);
 		if (NT_STATUS_IS_OK(status) && num_names) {
 			file_status &= ~NO_EAS;
 		}
@@ -1339,7 +1339,7 @@ static void call_nt_transact_create(connection_struct *conn,
 
 		/* Do we have any EA's ? */
 		status = get_ea_names_from_file(ctx, conn, fsp,
-				smb_fname->base_name, NULL, &num_names);
+				smb_fname, NULL, &num_names);
 		if (NT_STATUS_IS_OK(status) && num_names) {
 			file_status &= ~NO_EAS;
 		}
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index f9ae4a3..776e91d 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -1119,9 +1119,12 @@ bool samba_private_attr_name(const char *unix_ea_name);
 NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
 		      files_struct *fsp, const char *fname,
 		      const char *ea_name, struct ea_struct *pea);
-NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, connection_struct *conn,
-				files_struct *fsp, const char *fname,
-				char ***pnames, size_t *pnum_names);
+NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx,
+			connection_struct *conn,
+			files_struct *fsp,
+			const struct smb_filename *smb_fname,
+			char ***pnames,
+			size_t *pnum_names);
 NTSTATUS set_ea(connection_struct *conn, files_struct *fsp,
 		const struct smb_filename *smb_fname, struct ea_list *ea_list);
 struct ea_list *read_ea_list_entry(TALLOC_CTX *ctx, const char *pdata, size_t data_size, size_t *pbytes_used);
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index fd363b9..9c77a67 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -60,7 +60,7 @@ static char *store_file_unix_basic_info2(connection_struct *conn,
 
 static NTSTATUS refuse_symlink(connection_struct *conn,
 			const files_struct *fsp,
-			const char *name)
+			const struct smb_filename *smb_fname)
 {
 	SMB_STRUCT_STAT sbuf;
 	const SMB_STRUCT_STAT *pst = NULL;
@@ -69,7 +69,7 @@ static NTSTATUS refuse_symlink(connection_struct *conn,
 		pst = &fsp->fsp_name->st;
 	} else {
 		int ret = vfs_stat_smb_basename(conn,
-				name,
+				smb_fname->base_name,
 				&sbuf);
 		if (ret == -1) {
 			return map_nt_error_from_unix(errno);
@@ -230,9 +230,12 @@ NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
 	return NT_STATUS_OK;
 }
 
-NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, connection_struct *conn,
-				files_struct *fsp, const char *fname,
-				char ***pnames, size_t *pnum_names)
+NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx,
+				connection_struct *conn,
+				files_struct *fsp,
+				const struct smb_filename *smb_fname,
+				char ***pnames,
+				size_t *pnum_names)
 {


-- 
Samba Shared Repository



More information about the samba-cvs mailing list