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:
parent
a269ab4a9b
commit
6490ff6355
@ -2165,7 +2165,11 @@ static ssize_t ad_read_meta(vfs_handle_struct *handle,
|
|||||||
/* Now parse entries */
|
/* Now parse entries */
|
||||||
ok = ad_unpack(ad, ADEID_NUM_XATTR, AD_DATASZ_XATTR);
|
ok = ad_unpack(ad, ADEID_NUM_XATTR, AD_DATASZ_XATTR);
|
||||||
if (!ok) {
|
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;
|
errno = EINVAL;
|
||||||
rc = -1;
|
rc = -1;
|
||||||
goto exit;
|
goto exit;
|
||||||
@ -2374,8 +2378,10 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle,
|
|||||||
ADEID_NUM_DOT_UND,
|
ADEID_NUM_DOT_UND,
|
||||||
ad->ad_fsp->fsp_name->st.st_ex_size);
|
ad->ad_fsp->fsp_name->st.st_ex_size);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
DBG_ERR("invalid AppleDouble resource %s\n",
|
DBG_WARNING("Invalid AppleDouble resource (%s) in file: %s - "
|
||||||
smb_fname->base_name);
|
"Consider deleting the corrupted file.\n",
|
||||||
|
smb_fname->base_name,
|
||||||
|
ad->ad_fsp->fsp_name->base_name);
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
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_getentrylen(ad, ADEID_FINDERI) < ADEDLEN_FINDERI)
|
||||||
|| (ad_getentryoff(ad, ADEID_RFORK) < ADEDOFF_RFORK_DOT_UND))
|
|| (ad_getentryoff(ad, ADEID_RFORK) < ADEDOFF_RFORK_DOT_UND))
|
||||||
{
|
{
|
||||||
DBG_ERR("invalid AppleDouble resource %s\n",
|
DBG_WARNING("Invalid AppleDouble resource (%s) in file: %s - "
|
||||||
smb_fname->base_name);
|
"Consider deleting the corrupted file.\n",
|
||||||
|
smb_fname->base_name,
|
||||||
|
ad->ad_fsp->fsp_name->base_name);
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user