]> git.ipfire.org Git - thirdparty/samba.git/commit
vfs_fruit: change trigger points of AppleDouble conversion
authorRalph Boehme <slow@samba.org>
Tue, 21 May 2019 14:00:53 +0000 (16:00 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 13 Jun 2019 14:25:17 +0000 (14:25 +0000)
commit8b1dfd9b172de44214390953875953c78488b727
tree1aaf31a4ae67f0e389859fde9e9240cd63a07d24
parent267e70cb0d0c8a4da00c6bc2c46fa40fcf687b5d
vfs_fruit: change trigger points of AppleDouble conversion

This moves the trigger points where AppleDouble file conversion is run by
ad_convert() from deep down the callchain in ad_read_rsrc_adouble() to high
level VFS entry points.

Currently ad_convert() will be triggered as part of open_file_ntcreate(...,
"file:AFP_AfpResource", ...): after SMB_VFS_OPEN() has been called with O_CREAT,
what created the file, we call SMB_VFS_FSTAT() on the just created
filehandle. This ends up in ad_convert(), finds the resource fork empty and thus
deletes the file.

This commit moves calling of the conversion funtion to the high level VFS entry
points where the converted metadata is needed:

o for directory enumerations SMB_VFS_READDIR_ATTR() is called to fill in the
  repurposed fields in the directory entry metadata

o obviously for SMB_VFS_CREATE_FILE() on an macOS stream

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 78a4639b2d06cc69788861618d2e91945e142d2b)

Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-9-test): Thu Jun 13 14:25:17 UTC 2019 on sn-devel-144
selftest/knownfail.d/samba3.vfs.fruit
source3/modules/vfs_fruit.c