adouble: remove xattrs after successfull conversion
authorRalph Boehme <slow@samba.org>
Fri, 5 Jul 2019 09:42:11 +0000 (11:42 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 12 Jul 2019 21:31:29 +0000 (21:31 +0000)
This ensure the subsequent ad_fset() does not attempt to put back the xattrs on
disk in the AppleDouble file. It's not yet a problem as we don't have the code
that would do that, but that will be added in the next commit...

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/adouble.c

index 9ecd5decdd2c99b6e83ddb8f990bcf822f975596..184fe9130daf404bc5dad6e2d6e989b09bbad4bc 100644 (file)
@@ -895,6 +895,9 @@ static bool ad_convert_xattr(vfs_handle_struct *handle,
                fsp = NULL;
        }
 
+       ad->adx_header.adx_num_attrs = 0;
+       TALLOC_FREE(ad->adx_entries);
+
        ad_setentrylen(ad, ADEID_FINDERI, ADEDLEN_FINDERI);
 
        rc = ad_fset(handle, ad, ad->ad_fsp);