1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

vfs_fruit: move check in ad_convert() to ad_convert_*() subfunctions

Currently the whole conversion is skipped if the FinderInfo entry in the
AppleDouble file is of the default size (ie not containing xattrs).

That also means we never converted FinderInfo from the AppleDouble file
to stream format. This change finally fixes this.

Note that this keeps failing with streams_depot, much like the existing
known-fail of "samba3.vfs.fruit streams_depot.OS X AppleDouble file
conversion". Fixing the conversion to work with vfs_streams_depot is a
task for another day.

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>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Oct 11 01:30:13 CEST 2018 on sn-devel-144

(cherry picked from commit 31daab88e6a415e72ead69844e3eccf5dc02e53c)

Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-8-test): Thu Oct 18 17:37:52 CEST 2018 on sn-devel-144
This commit is contained in:
Ralph Boehme 2018-10-09 10:15:37 +02:00 committed by Karolin Seeger
parent a3ab52d3f4
commit 066d0ee3c9
2 changed files with 4 additions and 6 deletions

View File

@ -1,4 +1,2 @@
^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\)
^samba3.vfs.fruit metadata_netatalk.OS X AppleDouble file conversion without embedded xattr\(nt4_dc\)
^samba3.vfs.fruit metadata_stream.OS X AppleDouble file conversion without embedded xattr\(nt4_dc\)
^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion without embedded xattr\(nt4_dc\)

View File

@ -1010,6 +1010,10 @@ static bool ad_convert_xattr(struct adouble *ad,
*converted_xattr = false;
if (ad_getentrylen(ad, ADEID_FINDERI) == ADEDLEN_FINDERI) {
return true;
}
if (ad->adx_header.adx_num_attrs == 0) {
return true;
}
@ -1296,10 +1300,6 @@ static int ad_convert(struct adouble *ad,
bool ok;
bool converted_xattr = false;
if (ad_getentrylen(ad, ADEID_FINDERI) == ADEDLEN_FINDERI) {
return 0;
}
ok = ad_convert_xattr(ad, smb_fname, &converted_xattr);
if (!ok) {
return -1;