From: Noel Power Date: Sun, 31 Jan 2021 19:18:03 +0000 (+0000) Subject: s3/smbd: modify get_ea_names_from_file signature fn to take fsp alone X-Git-Tag: tevent-0.11.0~1720 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dfc80b4ce80a42e0c402ee7ba23e3cd2ad3ae279;p=thirdparty%2Fsamba.git s3/smbd: modify get_ea_names_from_file signature fn to take fsp alone Removes the smb_filename function parameter Signed-off-by: Noel Power Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index f66fad7d169..ca85ad86705 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -686,8 +686,7 @@ static NTSTATUS walk_xattr_streams(vfs_handle_struct *handle, status = get_ea_names_from_file(talloc_tos(), handle->conn, - fsp, - smb_fname, + smb_fname->fsp, &names, &num_names); if (!NT_STATUS_IS_OK(status)) { diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index c74cfa48c52..c2e25322766 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -788,7 +788,7 @@ void reply_ntcreate_and_X(struct smb_request *req) size_t num_names = 0; /* Do we have any EA's ? */ status = get_ea_names_from_file( - ctx, conn, fsp, smb_fname, NULL, &num_names); + ctx, conn, smb_fname->fsp, NULL, &num_names); if (NT_STATUS_IS_OK(status) && num_names) { file_status &= ~NO_EAS; } @@ -1466,7 +1466,7 @@ static void call_nt_transact_create(connection_struct *conn, size_t num_names = 0; /* Do we have any EA's ? */ status = get_ea_names_from_file( - ctx, conn, fsp, smb_fname, NULL, &num_names); + ctx, conn, smb_fname->fsp, 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 f0f947f44f6..5d7fee329f3 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -1215,7 +1215,6 @@ NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn, 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, diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index c3344b2b105..8cdd448a66b 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -294,7 +294,6 @@ NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, 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) { @@ -315,10 +314,11 @@ NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, } *pnum_names = 0; - status = refuse_symlink(conn, fsp, smb_fname); - if (!NT_STATUS_IS_OK(status)) { + if (fsp == NULL) { /* - * Just return no EA's on a symlink. + * Callers may pass fsp == NULL when passing smb_fname->fsp of a + * symlink. This is ok, handle it here, by just return no EA's + * on a symlink. */ return NT_STATUS_OK; } @@ -449,7 +449,6 @@ static NTSTATUS get_ea_list_from_file_path(TALLOC_CTX *mem_ctx, status = get_ea_names_from_file(talloc_tos(), conn, fsp, - smb_fname, &names, &num_names);