Cross-group file permissions in Linux

chmodchowngroupspermissionsusers

I have 2 users: Alice and Bob and 2 groups: Management and Personnel. Alice has primary group Management, and secondary groups Personnel and Alice. Bob has primary group Personnel and secondary group Bob.

Now they both need read/write access to the local Subversion repository in /var/svn/new-project/. The problem is that when Alice commits to the repository Bob can't commit to it anymore, due to the fact that he's not in Management group, which is Alice's primary group.

My question: how to enable both to read and write to the repository without messing up the permissions, while keeping them in separate primary groups, without chmod'ing the repo dir to 777 and without running a cronjob which fixes the permissions every minute?

Best Answer

You probably want to enable the setgid bit on the directory and set the group of the directory to be a common group (in this case, Personnel). setuid/setgid on a directory forces files created under it to be given the owner/group of the directory.