Basically I need any file filefoo that is newly created by userfoo or userbar, both members of groupfoo, in /Users/Shared/SpecialDirectory to have the same ownership that would be achieved by that user doing
chown whicheverusermadethefile:groupfoo filefoo after the fact.
(Longer story: I have two users running simultaneously on the same machine. The users have a shared folder at /Users/Shared/SpecialDirectory. These users, say userfoo and userbar, are both already members of a group groupfoo. userfoo syncs this directory using Dropbox, but Dropbox can't sync files downloaded by userbar into that directory b/c of permissions. File-by-file or a bunch at a time this problem can be solved with
chown and adding the right group ownership to the file or directory, but new downloads or additions continue to pose a problem. Thanks to some old tinkering with
umask the files are created with the correct group permissions such that userfoo's Dropbox instance can read and sync them when their ownership is anyuser:groupfoo, but the group itself is wrong because new file ownership defaults to userbar:staff instead of userbar:groupfoo.)
PS: This question is closest to the one I'm asking about, but the suggested solutions don't seem to apply since they don't ensure correct ownership of new files. Also, I could be wrong, but it looks like the questions here, here, and here aren't what I need, because the permissions are correct--it's the ownership that's wrong--and I need the fix to apply to any process creating any file (in particular b/c the bulk of these files-to-be-shared are pdfs downloaded by Chrome). This one also doesn't seem to do it--the directory itself is already owned by userfoo:groupfoo, yet new files created by userbar don't get the groupfoo gid.