vfs_fruit: fix ftruncating resource fork
commite414f60181af04c9eecb7b33875ffcbb3aafbade
authorRalph Boehme <slow@samba.org>
Wed, 11 Oct 2017 16:11:12 +0000 (11 18:11 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 25 Oct 2017 06:43:02 +0000 (25 08:43 +0200)
tree31780f702de009c296882e8c5e44cc3f0ddd4974
parentb86662654a51baa523896aaafb3a9d9cdc6628a9
vfs_fruit: fix ftruncating resource fork

fruit_ftruncate_rsrc_adouble() is called to effectively ftruncate() the
._ AppleDouble file to the requested size.

The VFS function SMB_VFS_NEXT_FTRUNCATE() otoh would attempt to truncate
to fsp *stream* in any way the next VFS module seems fit. As we know
we're stacked with a streams module, the module will attempt to truncate
the stream. So we're not truncating the ._ file.

This went unnoticed as the AppleDouble file header contains the
authorative resource fork size that was updated correctly.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 3d7932a33263514785fa3e95e2d5502bc02b4ea4)
source3/modules/vfs_fruit.c