vfs_fruit: never return AFP_Resource stream for directories
authorRalph Boehme <slow@samba.org>
Mon, 22 May 2023 17:37:17 +0000 (19:37 +0200)
committerJule Anger <janger@samba.org>
Wed, 31 May 2023 09:47:11 +0000 (09:47 +0000)
commitfe988c713798732b996de99684c73199ec68b70f
tree152a0e609fa301cc10df1f0c72b7ad8fe5302cd8
parent051cd8f5915615bed9ff8756661afffb794e42b4
vfs_fruit: never return AFP_Resource stream for directories

The macOS client creates ._ AppleDouble files for directories that do contain
an (empty) resource fork AppleDouble entry. So when going from a Samba server
config without streams module (or when migrating data from another server
without streams support), to a Samba config with a streams module and vfs_fruit,
fruit_streaminfo() will wrongly return the AFP_Resource from the AppleDouble
file as stream to the client.

To address this, just never return an AFP_Resource stream for directories when
listing streams in fruit_streaminfo(). ad_convert(), when configured with

  fruit:delete_empty_adfiles = true
  fruit:wipe_intentionally_left_blank_rfork = true

will happily discard the AFP_Resource from the AppleDouble file.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15378

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 06f0c070a0b18313f48362aa326e3e7e6a096492)
source3/modules/vfs_fruit.c