vfs_fruit: change trigger points of AppleDouble conversion
authorRalph Boehme <slow@samba.org>
Tue, 21 May 2019 14:00:53 +0000 (16:00 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 23 May 2019 23:26:15 +0000 (23:26 +0000)
commit78a4639b2d06cc69788861618d2e91945e142d2b
tree1ca6620ae381f99950cdb630d1877a5e6feeb66e
parent4777d1163a7c18c89ce9be955903427a18134415
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>
selftest/knownfail.d/samba3.vfs.fruit
source3/modules/vfs_fruit.c