How to make spotlight index files shared over AFP
Solution 1:
I found (what seems to be) a good solution after messing around and observing another AFP share that is working correctly. Turns out that the working folder has ACLs to allow spotlight indexing:
$ ls -led /Shared\ Items/Public/
drwxrwxr-x+ 19 root admin 646 May 6 12:47 /Shared Items/Public/
0: user:_spotlight inherited allow list,search,file_inherit,directory_inherit
New directories created inside a directory with this ACL will also inherit it. Files created inside the directory inherit a similar ACL: user:_spotlight inherited allow read,execute
. As it turns out, applying the allow list,search,file_inherit,directory_inherit
ACL to a regular file results in the file getting the simplified ACL (allow read,execute
). So my solution was to add the inherit
ACL recursively to the shared directory:
$ chmod -R +a 'user:_spotlight allow list,search,file_inherit,directory_inherit' /Shared
This solution worked perfectly. Now all my share content shows up in spotlight searches regardless of who owns them.