From 9e0b123eb8be7d6480fcc5bf7480617d35e3114d Mon Sep 17 00:00:00 2001 From: Noel Power Date: Tue, 2 Feb 2021 17:05:49 +0000 Subject: [PATCH] s3/smbd: prepare get_ea_list_from_file to receive fsp alone A step to transition away from using smb_fname & fsp parameter combination with this function by using the fsp provided by smb_filename->fsp Signed-off-by: Noel Power Reviewed-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/smbd/trans2.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 5206d383ea3..a9b821a8ef4 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -537,13 +537,18 @@ static NTSTATUS get_ea_list_from_file(TALLOC_CTX *mem_ctx, connection_struct *co return NT_STATUS_OK; } - if (is_ntfs_stream_smb_fname(smb_fname)) { + /* symlink */ + if (fsp == NULL) { + return NT_STATUS_OK; + } + + if (is_ntfs_stream_smb_fname(fsp->fsp_name)) { return NT_STATUS_INVALID_PARAMETER; } return get_ea_list_from_file_path(mem_ctx, conn, - smb_fname->fsp, + fsp, pea_total_len, ea_list); } @@ -5447,7 +5452,8 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn, DEBUG(10,("smbd_do_qfilepathinfo: SMB_INFO_QUERY_EAS_FROM_LIST\n")); status = - get_ea_list_from_file(mem_ctx, conn, fsp, + get_ea_list_from_file(mem_ctx, conn, + smb_fname->fsp, smb_fname, &total_ea_len, &ea_file_list); if (!NT_STATUS_IS_OK(status)) { @@ -5472,7 +5478,8 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn, size_t total_ea_len = 0; DEBUG(10,("smbd_do_qfilepathinfo: SMB_INFO_QUERY_ALL_EAS\n")); - status = get_ea_list_from_file(mem_ctx, conn, fsp, + status = get_ea_list_from_file(mem_ctx, conn, + smb_fname->fsp, smb_fname, &total_ea_len, &ea_list); if (!NT_STATUS_IS_OK(status)) { @@ -5500,7 +5507,8 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn, /*TODO: add filtering and index handling */ status = - get_ea_list_from_file(mem_ctx, conn, fsp, + get_ea_list_from_file(mem_ctx, conn, + smb_fname->fsp, smb_fname, &total_ea_len, &ea_file_list); if (!NT_STATUS_IS_OK(status)) { -- 2.47.3