LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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

Reply
 
Search this Thread
Old 12-31-2007, 06:50 AM   #1
xp_newbie
Member
 
Registered: Nov 2006
Posts: 86

Rep: Reputation: 16
Question CVS module (in repository) user:group - what is the correct approach?


I have setup a CVS pserver which works nicely for me, the user who first created the modules (subdirectories under /cvs).

The problem is when other users try to check out from that module (subdirectory under /cvs).

/cvs and /cvs/CVSROOT all belong to special 'user:group' that I created: 'cvs:cvs'.

Code:
drwxrwxr-x 3 cvs        cvs        4096 2007-12-30 13:25 CVSROOT
-rw-rw-r-- 1 cvs        cvs           0 2007-12-29 10:34 locks
drwxrwxr-x 8 xpnewbie   xpnewbie   4096 2007-12-30 06:53 mymodule
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:
  1. I don't know what would happen to a newly added file to the module (it would most certainly not receive 'xpnewbie:cvs' ownership.
  2. 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?

Thanks,
Alex
 
Old 01-01-2008, 04:41 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
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.
 
Old 01-01-2008, 06:38 PM   #3
xp_newbie
Member
 
Registered: Nov 2006
Posts: 86

Original Poster
Rep: Reputation: 16
Thumbs up

Thank you very much, gilead.

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?

Thanks,
Alex
 
Old 01-01-2008, 10:12 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
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.
 
Old 01-03-2008, 09:00 AM   #5
xp_newbie
Member
 
Registered: Nov 2006
Posts: 86

Original Poster
Rep: Reputation: 16
Lightbulb

Gilead, thanks again. This clarifies the issue.

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:

http://ioctl.org/unix/cvs/server

What a great community!

Cheers,
Alex
 
Old 01-03-2008, 01:28 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
No problem - glad it helped. Thank you for posting the link
 
  


Reply

Tags
automatically, chgrp, chown, cvs, gid, group, pserver, repository, users


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cvs repository cvs-1.11.21.tar.gz installation problem on redhat 5 linux version ajaytiwary Linux - Newbie 1 09-30-2007 12:58 PM
create a cvs repository with existing files to cvs powah Linux - Software 1 08-19-2005 09:19 AM
Creating CVS repository: cvs [import aborted]: attempt to import the repository enemorales Linux - Software 3 10-15-2004 04:30 PM
What is CVS repository? subaruwrx Linux - Newbie 7 07-13-2004 01:25 PM


All times are GMT -5. The time now is 09:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration