I am making multiple folders for users (userA/, userB/, etc.) where anyone can create/read a file/folder in any directory (userC can make fileX inside userA/). However, only the directory's owner can modify or delete the files within that folder (userC can only modify/delete files inside userC/).
I've tried changing the directory permissions to 7777, however the SUID doesn't apply to directories.
How do I allow uploaded files to inherit the directory owner?
Edit: UserZ owns directory dirZ/. UserZ can create (upload), modify, delete, and read everything inside dirZ/.
Likewise, UserY owns directory dirY/. User Y can create, modify, delete, and read everything inside dirY/.
UserY can access dirZ/. UserY can create or read anything inside dirZ/. UserY can not modify or delete anything inside dirZ/.
Likewise, UserZ can access dirY/. UserZ can create or read anything inside dirY/. UserZ can not modify or delete anything inside dirY/.