Search code examples
configurationpermissionscvs

Why is checkout permission denied on new folder creation for CVS?


We generally access our CVS server via Eclipse. One of our teammates, steveo created a new package Testing under our Java src folder for project ProjectName.

Afterwards, this caused failures with all checkouts for ProjectName.

The server reported an error while performing the "cvs checkout" command.

: cvs checkout: failed to create lock directory for `/app/cvs/repository/Main/ProjectName/src/Testing' (/app/cvs/repository/Main/ProjectName/src/Testing/#cvs.lock): Permission denied

: cvs checkout: failed to obtain dir lock in repository `/app/cvs/repository/Main/ProjectName/src/Testing'

: cvs [checkout aborted]: read lock failed - giving up

I putty'd to the CVS server and did an ls -l on the src folder

drwxrwxr-x 5 root cvs 4096 May 19 12:05 com

drwxrwxr-x 3 steveo steveo 4096 May 19 12:05 Testing

I sudo su, backed up to the project folder, and ran chgrp -R cvs ProjectName.

drwxrwxr-x 5 root cvs 4096 May 19 12:05 com

drwxrwxr-x 3 steveo cvs 4096 May 19 12:05 Testing

This has solved the issue for now... until another user creates a package.

What is causing this and how do I default them all to cvs instead?

The answers to this similar SO question were not helpful.


Solution

  • Figured it out and posting the answer for posterity.

    I was originally going to set the repository folder to group cvs and make it sticky via chmod g+s /app/cvs/repository/, but that is not recursive and I don't know that I want to mess with that.

    Default group id (GID) was not cvs for the users. The solution is a bit of a workaround as we're using Active Directory as our account login. Luckily, we're only using this server for CVS, which makes the solution simple.

    This must be done for each account and each new account.

    1. Make sure the account has attempted a log-in against CVS via Eclipse/RAD (and checked out a project, perhaps). This creates the user profile under home.
    2. sudo su
    3. cd \home\{username}
    4. Since we have nothing else going on in it, echo "newgrp cvs" >> .profile

    That will set the default group to cvs for the offending accounts on log-in and I can call it a day... and eventually migrate to Git / BitBucket.