From: Noel Power Date: Fri, 26 Feb 2021 14:09:52 +0000 (+0000) Subject: s3/smbd: modify get_ea_list_from_file_path fn signature to take fsp only X-Git-Tag: tevent-0.11.0~1717 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94c441c42e9b4a34c088e7cde5b30a05d03577b9;p=thirdparty%2Fsamba.git s3/smbd: modify get_ea_list_from_file_path fn signature to take fsp only Signed-off-by: Noel Power Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index b76e4e214ff..5206d383ea3 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -421,7 +421,6 @@ NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, static NTSTATUS get_ea_list_from_file_path(TALLOC_CTX *mem_ctx, connection_struct *conn, files_struct *fsp, - const struct smb_filename *smb_fname, size_t *pea_total_len, struct ea_list **ea_list) { @@ -439,13 +438,13 @@ static NTSTATUS get_ea_list_from_file_path(TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } - if (fsp) { - posix_pathnames = - (fsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH); - } else { - posix_pathnames = (smb_fname->flags & SMB_FILENAME_POSIX_PATH); + if (fsp == NULL) { + /* fsp == NULL => symlink */ + return NT_STATUS_OK; } + posix_pathnames = (fsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH); + status = get_ea_names_from_file(talloc_tos(), conn, fsp, @@ -485,7 +484,7 @@ static NTSTATUS get_ea_list_from_file_path(TALLOC_CTX *mem_ctx, status = get_ea_value(listp, conn, fsp, - smb_fname, + fsp->fsp_name, names[i], &listp->ea); @@ -544,8 +543,7 @@ static NTSTATUS get_ea_list_from_file(TALLOC_CTX *mem_ctx, connection_struct *co return get_ea_list_from_file_path(mem_ctx, conn, - fsp, - smb_fname, + smb_fname->fsp, pea_total_len, ea_list); } @@ -703,7 +701,6 @@ static unsigned int estimate_ea_size(connection_struct *conn, files_struct *fsp) (void)get_ea_list_from_file_path(mem_ctx, conn, fsp, - fsp->fsp_name, &total_ea_len, &ea_list); @@ -744,8 +741,7 @@ static void canonicalize_ea_name(connection_struct *conn, struct ea_list *ea_list; NTSTATUS status = get_ea_list_from_file_path(mem_ctx, conn, - fsp, - smb_fname, + smb_fname->fsp, &total_ea_len, &ea_list); if (!NT_STATUS_IS_OK(status)) {