CVS Sharing for OS/161

If you are working in a group, it is possible to set up your repository so that it can be shared everyone in your group. The idea is that the entire group shares a single repository, from which each member of the group can check out his/her own private working copy. When any member of the group makes changes in their private working copy and commits those changes, they go into the shared repository. When other members of the group update their working copies (using cvs update), those changes get propagated to their working copies. This is a great way for a group to share and coordinate access to the OS/161 source code.

To set up sharing, one member of the group should set up their repository for sharing, as described below. The other members of the group simply set their CVSROOT environment variables to refer to the shared repository. In the following, we will suppose that asmith and bjones have formed a project group. They have decided that asmith will set up the shared repository in her account, and bjones will share it. We will also suppose that asmith and bjones have registered themselves as a CS350 project group, an that they have been assigned group id cs350_023. Finally, we will suppose that asmith has already created an OS/161 CVS repository by following the OS/161 CVS setup instructions.

What bjones Must Do

To share a repository with asmith, all that bjones has to do is to set his CVSROOT environment variable to point to the repository that asmith has set up. That is, he should set his CVSROOT environment variable to ~asmith/cvsroot/cs350. To make sure that his CVSROOT environment variable is set automatically every time he logs in, he can include an appropriate setenv or export command in his .cshrc or .bashrc file, as described in the OS/161 CVS setup instructions.

What asmith Must Do

asmith must ensure that her CVS repository is accessible to her partner, but not accessible to the rest of the world. This is where the project group id comes in handy. First, she should change the group of all of the files and directories in the repository

chgrp -R cs350_023 ~/cvsroot/cs350

Next, she should make sure that there is group read permission on all files in the repository

chmod -R g+r ~/cvsroot/cs350

Next, she should make sure that there is group write and execute permission on all directories in the repository, and group write permission on a couple of other key files:

chmod g+wxs `find ~/cvsroot/cs350 -type d`
chmod g+w ~/cvsroot/cs350/CVSROOT/history
chmod g+w ~/cvsroot/cs350/CVSROOT/val-tags


Note the use of backquotes around the find command. Next, she should make sure that there are global "x" permissions on the directories along the path to the repository:

chmod o+x ~ ~/cvsroot

These must be global permissions, not just group permissions, because the group of asmith's home directory is not cs350_023 and cannot be changed to that.

Last but not least, asmith should make sure that none of the other files and directories in her home directory are world readable or world executable (unless she is deliberately sharing them, e.g., for another course). If she is not familiar with UNIX file access controls, she should read a brief overview of Unix file permissions, which explains how to check file access controls, and how to change them using chmod