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)
committerJeremy Allison <jra@samba.org>
Thu, 25 May 2023 23:59:33 +0000 (23:59 +0000)
commit06f0c070a0b18313f48362aa326e3e7e6a096492
tree98b30229997e4c7ad0a2356ab850b829c2646206
parent9b91a8bad2ff8da9eb56f1f9d640bcea294a5a0a
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>
source3/modules/vfs_fruit.c