1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

s3:lib: Give better warnings about corrupted AppleDobule files

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Apr 27 09:25:50 UTC 2023 on atb-devel-224
This commit is contained in:
Andreas Schneider 2023-04-26 08:40:29 +02:00 committed by Andreas Schneider
parent a269ab4a9b
commit 6490ff6355

View File

@ -2165,7 +2165,11 @@ static ssize_t ad_read_meta(vfs_handle_struct *handle,
/* Now parse entries */
ok = ad_unpack(ad, ADEID_NUM_XATTR, AD_DATASZ_XATTR);
if (!ok) {
DEBUG(2, ("invalid AppleDouble metadata xattr\n"));
DBG_WARNING(
"Invalid AppleDouble xattr metadata (%s) in file: %s - "
"Consider deleting the corrupted file.\n",
smb_fname->base_name,
ad->ad_fsp->fsp_name->base_name);
errno = EINVAL;
rc = -1;
goto exit;
@ -2374,8 +2378,10 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle,
ADEID_NUM_DOT_UND,
ad->ad_fsp->fsp_name->st.st_ex_size);
if (!ok) {
DBG_ERR("invalid AppleDouble resource %s\n",
smb_fname->base_name);
DBG_WARNING("Invalid AppleDouble resource (%s) in file: %s - "
"Consider deleting the corrupted file.\n",
smb_fname->base_name,
ad->ad_fsp->fsp_name->base_name);
errno = EINVAL;
return -1;
}
@ -2384,8 +2390,10 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle,
|| (ad_getentrylen(ad, ADEID_FINDERI) < ADEDLEN_FINDERI)
|| (ad_getentryoff(ad, ADEID_RFORK) < ADEDOFF_RFORK_DOT_UND))
{
DBG_ERR("invalid AppleDouble resource %s\n",
smb_fname->base_name);
DBG_WARNING("Invalid AppleDouble resource (%s) in file: %s - "
"Consider deleting the corrupted file.\n",
smb_fname->base_name,
ad->ad_fsp->fsp_name->base_name);
errno = EINVAL;
return -1;
}