Fixing CVS pserver Issues on Snow Leopard

This morning I was going to check something into one of the projects I host on my CVS repository running on my home server. I had done the transfer when the old Mac died, and thought I had it all going, but clearly I was wrong. Today I found another issue.

What I saw was that when I went into a checked-out project and did a cvs update, I got a nasty error message:

  peabody{drbob}3: cvs update
  ? src/CKPropertyChangeEvent.h
  ? src/CKPropertyChangeListener.h
  ? src/CKPropertyChangeSupport.h
  cvs update: failed to create lock directory for `/usr/local/CVSroot/CKit'
  (/usr/local/CVSroot/CKit/#cvs.lock): Permission denied
  cvs update: failed to obtain dir lock in repository `/usr/local/CVSroot/CKit'
  cvs [update aborted]: read lock failed - giving up

Clearly, I'd missed something else. Now I had to find it.

On the server, I have the CVS pserver set up as described here. The missing thing in this description is the permissions. Those are pretty simple:

  $ cd /usr/local
  $ sudo chown -R root:wheel CVSroot

so that everything in the repository is owned by root and the group wheel. Easy. I also made sure that everything is group writeable so taht if a user is in the group wheel, they can update/change the projects in the repository. Then, the username and group in the launchd plist makes sense. The problem is, my new account wasn't in the wheel group.

Because the CVS passwd file has just my username and encoded password, I'm required by cvs to have a valid account on that server. I do, but I also need to be able to read/write to the CVSroot to do any real operations on the projects in the repository. What I failed to do was to insure that my account had access to the same group.

To find out the groups you're in, simply use id:

  $ id
  uid=501(drbob) gid=20(staff) groups=20(staff),204(_developer),100(_lpoperator),
  98(_lpadmin),80(admin),61(localaccounts),12(everyone),
  401(com.apple.access_screensharing),402(com.apple.sharepoint.group.1)

and it's pretty clear that wheel isn't in that list. So let's add it:

  $ sudo dscl . append /Groups/wheel GroupMembership drbob

and now id shows us what we need to see:

  $ id
  uid=501(drbob) gid=20(staff) groups=20(staff),204(_developer),100(_lpoperator),
  98(_lpadmin),80(admin),61(localaccounts),12(everyone),0(wheel),
  401(com.apple.access_screensharing),402(com.apple.sharepoint.group.1)

Yup, right there on the end of the second line is wheel. Now I can do cvs updates without a problem. Good enough.