From: Ralph Boehme Date: Fri, 5 Oct 2018 14:14:40 +0000 (+0200) Subject: vfs_fruit: move storing of modified struct adouble to ad_convert() X-Git-Tag: samba-4.8.8~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cff660fd79f25ae8ad63197206b3511431460bbc;p=thirdparty%2Fsamba.git 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 Reviewed-by: Jeremy Allison (cherry picked from commit b355a09576563d0f681d0bf830d0e2c769533399) --- diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index ab85739daa2..62cd60c9a9c 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -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;