CVS module (in repository) user:group - what is the correct approach?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
As you can see, when I first created 'mymodule' (using import/commit), it was created with the ownership of xpnewbie:xpnewbie, not xpnewbie:cvs as I had hoped.
My question is: What is the right approach to tackle this problem?
Of course I could perform a 'chown -R xpnewbie:cvs mymodule' but then:
I don't know what would happen to a newly added file to the module (it would most certainly not receive 'xpnewbie:cvs' ownership.
I will have to repeat this (manual) procedure every time I create a new module.
Is there a way to tell CVS/pserver to automatically assign the group 'cvs' to any newly checked in module/file?
There are a couple of ways to approach this. The first is to put all CVS users into a cvs group, run chgrp cvs over the modules and then set the gid bit on all of the module directories:
Code:
find /path/to/cvsrepo/module -type d -exec chmod g+sw {} \;
That way all cvs group members will have write permission and all new files will belong to the cvs group.
The second way is to have a single cvs user and add your repository users added to CVSROOT/passwd. The cvs user owns the modules and the problem of multiple system users owning the files goes away.
I like the first way better, because it allows keeping track of who performed what in the CVS repositories.
However, it also means that every time a new repository is added, I will have to perform that 'chgrp cvs' and 'chmod g+sw'...
Is there a way to avoid that? Can I just do 'chmod g+sw' on /cvs, thus assuming from now on that every newly created repository (via cvs command, of course) will automatically receive g+sw as well?
Also, do I understand correctly that the 's' in the g+sw, simply makes every newly created directory/file belong to the cvs group?
Yes, to both... You can run chmod g+sw on the top level directory so that you don't need to run it on each new module. The 's' does cause each new directory/file to belong to the cvs group.
For future reference, I am posting here a link that, although refers to ssh clients (vs. pserver), provides additional clues for finer granularity when needing to control access to CVS repositories:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.