Create a CVS repository-snippet

From CISSTwiki

Jump to: navigation, search


Contents

Keywords

cvs, repository, spine, admin, system

Description

This requires the help of a system administrator. As of November 2007, the CVS server is spine.compsci.jhu.edu and we are using the pserver protocol. We hope to move our core projects to subversion in a foreseeable future.

Server side

The first part is performed on the server and requires administrator rights:

  • Go in /home/cvs
  • Create a directory for the new repository, let's say project
  • Initialize the directory for CVS using cvs -d /home/cvs/project init
  • In /home/cvs/project/CVSROOT, create a file called passwd. This file will contain entries such as (see section on adding user to generate the password):
# Anton Deguet, JHU
anton:cTgcuEsRVdcA:cvsuser
  • Make sure the permissions are right using:
    • chown -Rh cvsuser.cvs /home/cvs/project
    • chmod -R o-rwx /home/cvs/project
  • Modify the server, i.e. the xinetd script used to handle requests on the CVS port: /etc/xinetd.d/cvspserver, add the --allow-root for your project directory.
  • Restart or reload xinetd configuration using /etc/init.d/xinetd reload

User side

The second step happens on the client side. The goal is to import some files to create a new module on the cvs server. This step requires to login using the pserver protocol. To do so, set the CVSROOT environment variable:

  • Using bash/sh, export CVSROOT=:pserver:username@spine.compsci.jhu.edu:/home/cvs/project
  • Then login using cvs login
  • Go in the directory containing the files you wish to use for your new module. Make sure the directory and its subdirectories are clean, i.e. they only contain files you want to import. PS: You can not have a directory called CVS!
  • Create a module using cvs import -m "message here" module_name vendor_name release. For example, cvs import -m "Added to CVS" module1 Anton initial. Make sure you are in the directory containing the files you want to import.
  • To test, create a new directory where you can checkout the newly create module and then, in this new directory, type: cvs co module1

Adding users

To create new users, you will need to edit the CVSROOT/passwd file. Please add a line with a comment # to give a full description of the user. To generate the password, there is a perl script in /home/cvs. If the user insists on creating his own password, he/she can do so using the same script:

#!/usr/bin/perl
srand(time());
my $randletter = "(int (rand(26)) + (int (rand(1) + .5) %2 ?65 : 97))";
my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
my $plaintext = shift;
my $crypttext = crypt($plaintext, $salt);
print "${crypttext}\\n";

WARNING: In any case, the password is sent as is on the net. Therefore, it is strongly recommended to use a non critical password, i.e. not you main login password or your bank account password.

Created by

Anton Deguet


Views
Personal tools