1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

vfs_fruit: move storing of modified struct adouble to ad_convert()

ad_convert() modified it, so let ad_convert() also save it to disk. No
change in behaviour.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13649

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2018-10-05 16:14:40 +02:00
parent 99cc9ef82b
commit b355a09576

View File

@ -1071,6 +1071,7 @@ static int ad_convert(struct adouble *ad,
int rc = 0;
char *map = MAP_FAILED;
size_t origlen;
ssize_t len;
bool ok;
origlen = ad_getentryoff(ad, ADEID_RFORK) +
@ -1116,6 +1117,18 @@ static int ad_convert(struct adouble *ad,
return -1;
}
ok = ad_pack(ad);
if (!ok) {
DBG_WARNING("ad_pack [%s] failed\n", smb_fname->base_name);
return -1;
}
len = sys_pwrite(ad->ad_fd, ad->ad_data, AD_DATASZ_DOT_UND, 0);
if (len != AD_DATASZ_DOT_UND) {
DBG_ERR("%s: bad size: %zd\n", smb_fname->base_name, len);
return -1;
}
return 0;
}
@ -1391,18 +1404,6 @@ static ssize_t ad_read_rsrc_adouble(struct adouble *ad,
return len;
}
ok = ad_pack(ad);
if (!ok) {
DBG_WARNING("ad_pack [%s] failed\n", smb_fname->base_name);
return -1;
}
len = sys_pwrite(ad->ad_fd, ad->ad_data, AD_DATASZ_DOT_UND, 0);
if (len != AD_DATASZ_DOT_UND) {
DBG_ERR("%s: bad size: %zd\n", smb_fname->base_name, len);
return -1;
}
p_ad = ad_get_entry(ad, ADEID_FINDERI);
if (p_ad == NULL) {
return -1;