From: Jeremy Allison Date: Wed, 23 Jun 2021 00:31:41 +0000 (-0700) Subject: s3: smbd: Temporarily add protection to get_ea_value() for fsp==NULL and smb_fname... X-Git-Tag: tevent-0.11.0~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4670cf1da6feb7e7316db42079ce43ff22f7015e;p=thirdparty%2Fsamba.git s3: smbd: Temporarily add protection to get_ea_value() for fsp==NULL and smb_fname==NULL. This will go away once get_ea_value() is fully handle-based and renamed to get_ea_value_fsp(). Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 5c4f60821c9..40391a4a9c1 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -245,6 +245,14 @@ NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, if (fsp) { sizeret = SMB_VFS_FGETXATTR(fsp, ea_name, val, attr_size); } else { + if (smb_fname == NULL) { + /* + * fsp == NULL and smb_fname == NULL. + * This check will go away once get_ea_value() + * is completely fsp-based. + */ + return NT_STATUS_INVALID_HANDLE; + } sizeret = SMB_VFS_GETXATTR(conn, smb_fname, ea_name, val, attr_size); }