1*43c1707eStholoThis is cvs.info, produced by makeinfo version 4.0 from cvs.texinfo. 21e72d8d2Sderaadt 36407bc5bStholoSTART-INFO-DIR-ENTRY 46407bc5bStholo* CVS: (cvs). Concurrent Versions System 56407bc5bStholoEND-INFO-DIR-ENTRY 66407bc5bStholo 71e72d8d2Sderaadt Copyright (C) 1992, 1993 Signum Support AB Copyright (C) 1993, 1994 81e72d8d2SderaadtFree Software Foundation, Inc. 91e72d8d2Sderaadt 101e72d8d2Sderaadt Permission is granted to make and distribute verbatim copies of this 111e72d8d2Sderaadtmanual provided the copyright notice and this permission notice are 121e72d8d2Sderaadtpreserved on all copies. 131e72d8d2Sderaadt 141e72d8d2Sderaadt Permission is granted to copy and distribute modified versions of 151e72d8d2Sderaadtthis manual under the conditions for verbatim copying, provided also 166407bc5bStholothat the entire resulting derived work is distributed under the terms 176407bc5bStholoof a permission notice identical to this one. 181e72d8d2Sderaadt 191e72d8d2Sderaadt Permission is granted to copy and distribute translations of this 201e72d8d2Sderaadtmanual into another language, under the above conditions for modified 216407bc5bStholoversions, except that this permission notice may be stated in a 226407bc5bStholotranslation approved by the Free Software Foundation. 231e72d8d2Sderaadt 241e72d8d2Sderaadt 252f9d2fd9StholoFile: cvs.info, Node: Intro administrative files, Next: Multiple repositories, Prev: Working directory storage, Up: Repository 262f9d2fd9Stholo 272f9d2fd9StholoThe administrative files 282f9d2fd9Stholo======================== 292f9d2fd9Stholo 302f9d2fd9Stholo The directory `$CVSROOT/CVSROOT' contains some "administrative 312f9d2fd9Stholofiles". *Note Administrative files::, for a complete description. You 322f9d2fd9Stholocan use CVS without any of these files, but some commands work better 332f9d2fd9Stholowhen at least the `modules' file is properly set up. 342f9d2fd9Stholo 352f9d2fd9Stholo The most important of these files is the `modules' file. It defines 362f9d2fd9Stholoall modules in the repository. This is a sample `modules' file. 372f9d2fd9Stholo 382f9d2fd9Stholo CVSROOT CVSROOT 392f9d2fd9Stholo modules CVSROOT modules 402f9d2fd9Stholo cvs gnu/cvs 412f9d2fd9Stholo rcs gnu/rcs 422f9d2fd9Stholo diff gnu/diff 432f9d2fd9Stholo tc yoyodyne/tc 442f9d2fd9Stholo 452f9d2fd9Stholo The `modules' file is line oriented. In its simplest form each line 462f9d2fd9Stholocontains the name of the module, whitespace, and the directory where 472f9d2fd9Stholothe module resides. The directory is a path relative to `$CVSROOT'. 482f9d2fd9StholoThe last four lines in the example above are examples of such lines. 492f9d2fd9Stholo 502f9d2fd9Stholo The line that defines the module called `modules' uses features that 512f9d2fd9Stholoare not explained here. *Note modules::, for a full explanation of all 522f9d2fd9Stholothe available features. 532f9d2fd9Stholo 542f9d2fd9StholoEditing administrative files 552f9d2fd9Stholo---------------------------- 562f9d2fd9Stholo 572f9d2fd9Stholo You edit the administrative files in the same way that you would edit 582f9d2fd9Stholoany other module. Use `cvs checkout CVSROOT' to get a working copy, 592f9d2fd9Stholoedit it, and commit your changes in the normal way. 602f9d2fd9Stholo 612f9d2fd9Stholo It is possible to commit an erroneous administrative file. You can 622f9d2fd9Stholooften fix the error and check in a new revision, but sometimes a 632f9d2fd9Stholoparticularly bad error in the administrative file makes it impossible 642f9d2fd9Stholoto commit new revisions. 652f9d2fd9Stholo 662f9d2fd9Stholo 672f9d2fd9StholoFile: cvs.info, Node: Multiple repositories, Next: Creating a repository, Prev: Intro administrative files, Up: Repository 682f9d2fd9Stholo 692f9d2fd9StholoMultiple repositories 702f9d2fd9Stholo===================== 712f9d2fd9Stholo 722f9d2fd9Stholo In some situations it is a good idea to have more than one 732f9d2fd9Stholorepository, for instance if you have two development groups that work 742f9d2fd9Stholoon separate projects without sharing any code. All you have to do to 752f9d2fd9Stholohave several repositories is to specify the appropriate repository, 762f9d2fd9Stholousing the `CVSROOT' environment variable, the `-d' option to CVS, or 772f9d2fd9Stholo(once you have checked out a working directory) by simply allowing CVS 782f9d2fd9Stholoto use the repository that was used to check out the working directory 79e77048c1Stholo(*note Specifying a repository::). 802f9d2fd9Stholo 812f9d2fd9Stholo The big advantage of having multiple repositories is that they can 822f9d2fd9Stholoreside on different servers. With CVS version 1.10, a single command 832f9d2fd9Stholocannot recurse into directories from different repositories. With 842f9d2fd9Stholodevelopment versions of CVS, you can check out code from multiple 852f9d2fd9Stholoservers into your working directory. CVS will recurse and handle all 862f9d2fd9Stholothe details of making connections to as many server machines as 872f9d2fd9Stholonecessary to perform the requested command. Here is an example of how 882f9d2fd9Stholoto set up a working directory: 892f9d2fd9Stholo 902f9d2fd9Stholo cvs -d server1:/cvs co dir1 912f9d2fd9Stholo cd dir1 922f9d2fd9Stholo cvs -d server2:/root co sdir 932f9d2fd9Stholo cvs update 942f9d2fd9Stholo 952f9d2fd9Stholo The `cvs co' commands set up the working directory, and then the 962f9d2fd9Stholo`cvs update' command will contact server2, to update the dir1/sdir 972f9d2fd9Stholosubdirectory, and server1, to update everything else. 982f9d2fd9Stholo 992f9d2fd9Stholo 1008506102dStholoFile: cvs.info, Node: Creating a repository, Next: Backing up, Prev: Multiple repositories, Up: Repository 1018506102dStholo 1028506102dStholoCreating a repository 1038506102dStholo===================== 1048506102dStholo 1058506102dStholo To set up a CVS repository, first choose the machine and disk on 1068506102dStholowhich you want to store the revision history of the source files. CPU 1078506102dStholoand memory requirements are modest, so most machines should be 1088506102dStholoadequate. For details see *Note Server requirements::. 1098506102dStholo 1108506102dStholo To estimate disk space requirements, if you are importing RCS files 1118506102dStholofrom another system, the size of those files is the approximate initial 1128506102dStholosize of your repository, or if you are starting without any version 1138506102dStholohistory, a rule of thumb is to allow for the server approximately three 1148506102dStholotimes the size of the code to be under CVS for the repository (you will 1158506102dStholoeventually outgrow this, but not for a while). On the machines on 1168506102dStholowhich the developers will be working, you'll want disk space for 1178506102dStholoapproximately one working directory for each developer (either the 1188506102dStholoentire tree or a portion of it, depending on what each developer uses). 1198506102dStholo 1208506102dStholo The repository should be accessible (directly or via a networked 1218506102dStholofile system) from all machines which want to use CVS in server or local 1228506102dStholomode; the client machines need not have any access to it other than via 1238506102dStholothe CVS protocol. It is not possible to use CVS to read from a 1248506102dStholorepository which one only has read access to; CVS needs to be able to 125e77048c1Stholocreate lock files (*note Concurrency::). 1268506102dStholo 1278506102dStholo To create a repository, run the `cvs init' command. It will set up 1288506102dStholoan empty repository in the CVS root specified in the usual way (*note 129e77048c1StholoRepository::). For example, 1308506102dStholo 1318506102dStholo cvs -d /usr/local/cvsroot init 1328506102dStholo 1338506102dStholo `cvs init' is careful to never overwrite any existing files in the 1348506102dStholorepository, so no harm is done if you run `cvs init' on an already 1358506102dStholoset-up repository. 1368506102dStholo 1378506102dStholo `cvs init' will enable history logging; if you don't want that, 1388506102dStholoremove the history file after running `cvs init'. *Note history file::. 1398506102dStholo 1408506102dStholo 141f79d7d1bStholoFile: cvs.info, Node: Backing up, Next: Moving a repository, Prev: Creating a repository, Up: Repository 142f79d7d1bStholo 143f79d7d1bStholoBacking up a repository 144f79d7d1bStholo======================= 145f79d7d1bStholo 146f79d7d1bStholo There is nothing particularly magical about the files in the 147f79d7d1bStholorepository; for the most part it is possible to back them up just like 148f79d7d1bStholoany other files. However, there are a few issues to consider. 149f79d7d1bStholo 150f79d7d1bStholo The first is that to be paranoid, one should either not use CVS 151f79d7d1bStholoduring the backup, or have the backup program lock CVS while doing the 152f79d7d1bStholobackup. To not use CVS, you might forbid logins to machines which can 153f79d7d1bStholoaccess the repository, turn off your CVS server, or similar mechanisms. 154f79d7d1bStholoThe details would depend on your operating system and how you have CVS 155f79d7d1bStholoset up. To lock CVS, you would create `#cvs.rfl' locks in each 156f79d7d1bStholorepository directory. See *Note Concurrency::, for more on CVS locks. 157f79d7d1bStholoHaving said all this, if you just back up without any of these 158f79d7d1bStholoprecautions, the results are unlikely to be particularly dire. 159f79d7d1bStholoRestoring from backup, the repository might be in an inconsistent 160f79d7d1bStholostate, but this would not be particularly hard to fix manually. 161f79d7d1bStholo 162f79d7d1bStholo When you restore a repository from backup, assuming that changes in 163f79d7d1bStholothe repository were made after the time of the backup, working 164f79d7d1bStholodirectories which were not affected by the failure may refer to 165f79d7d1bStholorevisions which no longer exist in the repository. Trying to run CVS 166f79d7d1bStholoin such directories will typically produce an error message. One way 167f79d7d1bStholoto get those changes back into the repository is as follows: 168f79d7d1bStholo 169f79d7d1bStholo * Get a new working directory. 170f79d7d1bStholo 171f79d7d1bStholo * Copy the files from the working directory from before the failure 172f79d7d1bStholo over to the new working directory (do not copy the contents of the 173f79d7d1bStholo `CVS' directories, of course). 174f79d7d1bStholo 175f79d7d1bStholo * Working in the new working directory, use commands such as `cvs 176f79d7d1bStholo update' and `cvs diff' to figure out what has changed, and then 177f79d7d1bStholo when you are ready, commit the changes into the repository. 178f79d7d1bStholo 179f79d7d1bStholo 180565bb110StholoFile: cvs.info, Node: Moving a repository, Next: Remote repositories, Prev: Backing up, Up: Repository 181565bb110Stholo 182565bb110StholoMoving a repository 183565bb110Stholo=================== 184565bb110Stholo 185565bb110Stholo Just as backing up the files in the repository is pretty much like 186565bb110Stholobacking up any other files, if you need to move a repository from one 187565bb110Stholoplace to another it is also pretty much like just moving any other 188565bb110Stholocollection of files. 189565bb110Stholo 190565bb110Stholo The main thing to consider is that working directories point to the 191565bb110Stholorepository. The simplest way to deal with a moved repository is to 192565bb110Stholojust get a fresh working directory after the move. Of course, you'll 193565bb110Stholowant to make sure that the old working directory had been checked in 194565bb110Stholobefore the move, or you figured out some other way to make sure that 195565bb110Stholoyou don't lose any changes. If you really do want to reuse the existing 196565bb110Stholoworking directory, it should be possible with manual surgery on the 197565bb110Stholo`CVS/Repository' files. You can see *Note Working directory storage::, 198565bb110Stholofor information on the `CVS/Repository' and `CVS/Root' files, but 199565bb110Stholounless you are sure you want to bother, it probably isn't worth it. 200565bb110Stholo 201565bb110Stholo 202565bb110StholoFile: cvs.info, Node: Remote repositories, Next: Read-only access, Prev: Moving a repository, Up: Repository 203565bb110Stholo 204565bb110StholoRemote repositories 205565bb110Stholo=================== 206565bb110Stholo 207565bb110Stholo Your working copy of the sources can be on a different machine than 208565bb110Stholothe repository. Using CVS in this manner is known as "client/server" 209565bb110Stholooperation. You run CVS on a machine which can mount your working 210565bb110Stholodirectory, known as the "client", and tell it to communicate to a 211565bb110Stholomachine which can mount the repository, known as the "server". 212565bb110StholoGenerally, using a remote repository is just like using a local one, 213565bb110Stholoexcept that the format of the repository name is: 214565bb110Stholo 215*43c1707eStholo :METHOD:[[USER][:PASSWORD]@]HOSTNAME[:[PORT]]/path/to/repository 216*43c1707eStholo 217*43c1707eStholo Specifying a password in the repository name is not recommended 218*43c1707eStholoduring checkout, since this will cause CVS to store a cleartext copy of 219*43c1707eStholothe password in each created directory. `cvs login' first instead 220*43c1707eStholo(*note Password authentication client::). 221565bb110Stholo 222565bb110Stholo The details of exactly what needs to be set up depend on how you are 223565bb110Stholoconnecting to the server. 224565bb110Stholo 225565bb110Stholo If METHOD is not specified, and the repository name contains `:', 226565bb110Stholothen the default is `ext' or `server', depending on your platform; both 227565bb110Stholoare described in *Note Connecting via rsh::. 228565bb110Stholo 229565bb110Stholo* Menu: 230565bb110Stholo 231565bb110Stholo* Server requirements:: Memory and other resources for servers 232565bb110Stholo* Connecting via rsh:: Using the `rsh' program to connect 233565bb110Stholo* Password authenticated:: Direct connections using passwords 234f79d7d1bStholo* GSSAPI authenticated:: Direct connections using GSSAPI 235565bb110Stholo* Kerberos authenticated:: Direct connections with kerberos 2368506102dStholo* Connecting via fork:: Using a forked `cvs server' to connect 237565bb110Stholo 238565bb110Stholo 239565bb110StholoFile: cvs.info, Node: Server requirements, Next: Connecting via rsh, Up: Remote repositories 240565bb110Stholo 241565bb110StholoServer requirements 242565bb110Stholo------------------- 243565bb110Stholo 244565bb110Stholo The quick answer to what sort of machine is suitable as a server is 245565bb110Stholothat requirements are modest--a server with 32M of memory or even less 246565bb110Stholocan handle a fairly large source tree with a fair amount of activity. 247565bb110Stholo 248f79d7d1bStholo The real answer, of course, is more complicated. Estimating the 249f79d7d1bStholoknown areas of large memory consumption should be sufficient to 250f79d7d1bStholoestimate memory requirements. There are two such areas documented 251f79d7d1bStholohere; other memory consumption should be small by comparison (if you 252f79d7d1bStholofind that is not the case, let us know, as described in *Note BUGS::, 253f79d7d1bStholoso we can update this documentation). 254f79d7d1bStholo 255f79d7d1bStholo The first area of big memory consumption is large checkouts, when 256f79d7d1bStholousing the CVS server. The server consists of two processes for each 257f79d7d1bStholoclient that it is serving. Memory consumption on the child process 258f79d7d1bStholoshould remain fairly small. Memory consumption on the parent process, 259f79d7d1bStholoparticularly if the network connection to the client is slow, can be 260f79d7d1bStholoexpected to grow to slightly more than the size of the sources in a 261f79d7d1bStholosingle directory, or two megabytes, whichever is larger. 262565bb110Stholo 263565bb110Stholo Multiplying the size of each CVS server by the number of servers 264565bb110Stholowhich you expect to have active at one time should give an idea of 265565bb110Stholomemory requirements for the server. For the most part, the memory 266565bb110Stholoconsumed by the parent process probably can be swap space rather than 267565bb110Stholophysical memory. 268565bb110Stholo 269f79d7d1bStholo The second area of large memory consumption is `diff', when checking 270f79d7d1bStholoin large files. This is required even for binary files. The rule of 271f79d7d1bStholothumb is to allow about ten times the size of the largest file you will 272f79d7d1bStholowant to check in, although five times may be adequate. For example, if 273f79d7d1bStholoyou want to check in a file which is 10 megabytes, you should have 100 274f79d7d1bStholomegabytes of memory on the machine doing the checkin (the server 275f79d7d1bStholomachine for client/server, or the machine running CVS for 276f79d7d1bStholonon-client/server). This can be swap space rather than physical 277f79d7d1bStholomemory. Because the memory is only required briefly, there is no 278f79d7d1bStholoparticular need to allow memory for more than one such checkin at a 279f79d7d1bStholotime. 280f79d7d1bStholo 281f79d7d1bStholo Resource consumption for the client is even more modest--any machine 282f79d7d1bStholowith enough capacity to run the operating system in question should 283f79d7d1bStholohave little trouble. 284f79d7d1bStholo 285f79d7d1bStholo For information on disk space requirements, see *Note Creating a 286f79d7d1bStholorepository::. 287565bb110Stholo 288565bb110Stholo 289565bb110StholoFile: cvs.info, Node: Connecting via rsh, Next: Password authenticated, Prev: Server requirements, Up: Remote repositories 290565bb110Stholo 291565bb110StholoConnecting with rsh 292565bb110Stholo------------------- 293565bb110Stholo 294565bb110Stholo CVS uses the `rsh' protocol to perform these operations, so the 295565bb110Stholoremote user host needs to have a `.rhosts' file which grants access to 296565bb110Stholothe local user. 297565bb110Stholo 298565bb110Stholo For example, suppose you are the user `mozart' on the local machine 2998506102dStholo`toe.example.com', and the server machine is `faun.example.org'. On 3008506102dStholofaun, put the following line into the file `.rhosts' in `bach''s home 3018506102dStholodirectory: 302565bb110Stholo 3038506102dStholo toe.example.com mozart 304565bb110Stholo 305565bb110Stholo Then test that `rsh' is working with 306565bb110Stholo 3078506102dStholo rsh -l bach faun.example.org 'echo $PATH' 308565bb110Stholo 309565bb110Stholo Next you have to make sure that `rsh' will be able to find the 310565bb110Stholoserver. Make sure that the path which `rsh' printed in the above 311565bb110Stholoexample includes the directory containing a program named `cvs' which 312565bb110Stholois the server. You need to set the path in `.bashrc', `.cshrc', etc., 313565bb110Stholonot `.login' or `.profile'. Alternately, you can set the environment 314565bb110Stholovariable `CVS_SERVER' on the client machine to the filename of the 315565bb110Stholoserver you want to use, for example `/usr/local/bin/cvs-1.6'. 316565bb110Stholo 317565bb110Stholo There is no need to edit `inetd.conf' or start a CVS server daemon. 318565bb110Stholo 319e77048c1Stholo There are two access methods that you use in `CVSROOT' for rsh. 320565bb110Stholo`:server:' specifies an internal rsh client, which is supported only by 321565bb110Stholosome CVS ports. `:ext:' specifies an external rsh program. By default 322565bb110Stholothis is `rsh' but you may set the `CVS_RSH' environment variable to 323565bb110Stholoinvoke another program which can access the remote server (for example, 324565bb110Stholo`remsh' on HP-UX 9 because `rsh' is something different). It must be a 325565bb110Stholoprogram which can transmit data to and from the server without modifying 326565bb110Stholoit; for example the Windows NT `rsh' is not suitable since it by 327565bb110Stholodefault translates between CRLF and LF. The OS/2 CVS port has a hack 328565bb110Stholoto pass `-b' to `rsh' to get around this, but since this could 329565bb110Stholopotentially cause problems for programs other than the standard `rsh', 330565bb110Stholoit may change in the future. If you set `CVS_RSH' to `SSH' or some 331565bb110Stholoother rsh replacement, the instructions in the rest of this section 332565bb110Stholoconcerning `.rhosts' and so on are likely to be inapplicable; consult 333565bb110Stholothe documentation for your rsh replacement. 334565bb110Stholo 335565bb110Stholo Continuing our example, supposing you want to access the module 336565bb110Stholo`foo' in the repository `/usr/local/cvsroot/', on machine 3378506102dStholo`faun.example.org', you are ready to go: 338565bb110Stholo 339*43c1707eStholo cvs -d :ext:bach@faun.example.org/usr/local/cvsroot checkout foo 340565bb110Stholo 341565bb110Stholo (The `bach@' can be omitted if the username is the same on both the 342565bb110Sthololocal and remote hosts.) 343565bb110Stholo 344565bb110Stholo 345f79d7d1bStholoFile: cvs.info, Node: Password authenticated, Next: GSSAPI authenticated, Prev: Connecting via rsh, Up: Remote repositories 3462e7fa898Stholo 3472e7fa898StholoDirect connection with password authentication 3482e7fa898Stholo---------------------------------------------- 3492e7fa898Stholo 3502e7fa898Stholo The CVS client can also connect to the server using a password 3512e7fa898Stholoprotocol. This is particularly useful if using `rsh' is not feasible 3522e7fa898Stholo(for example, the server is behind a firewall), and Kerberos also is 3532e7fa898Stholonot available. 3542e7fa898Stholo 3552e7fa898Stholo To use this method, it is necessary to make some adjustments on both 3562e7fa898Stholothe server and client sides. 3572e7fa898Stholo 3582e7fa898Stholo* Menu: 3592e7fa898Stholo 3602e7fa898Stholo* Password authentication server:: Setting up the server 3612e7fa898Stholo* Password authentication client:: Using the client 3622e7fa898Stholo* Password authentication security:: What this method does and does not do 3632e7fa898Stholo 3642e7fa898Stholo 3652e7fa898StholoFile: cvs.info, Node: Password authentication server, Next: Password authentication client, Up: Password authenticated 3662e7fa898Stholo 3672e7fa898StholoSetting up the server for password authentication 3682e7fa898Stholo................................................. 3692e7fa898Stholo 370f79d7d1bStholo First of all, you probably want to tighten the permissions on the 371f79d7d1bStholo`$CVSROOT' and `$CVSROOT/CVSROOT' directories. See *Note Password 372f79d7d1bStholoauthentication security::, for more details. 373f79d7d1bStholo 3742e7fa898Stholo On the server side, the file `/etc/inetd.conf' needs to be edited so 3752e7fa898Stholo`inetd' knows to run the command `cvs pserver' when it receives a 3762e7fa898Stholoconnection on the right port. By default, the port number is 2401; it 3772e7fa898Stholowould be different if your client were compiled with `CVS_AUTH_PORT' 378*43c1707eStholodefined to something else, though. This can also be sepcified in the 379*43c1707eStholoCVSROOT variable (*note Remote repositories::) or overridden with the 380*43c1707eStholoCVS_CLIENT_PORT environment variable (*note Environment variables::). 3812e7fa898Stholo 3822e7fa898Stholo If your `inetd' allows raw port numbers in `/etc/inetd.conf', then 3832e7fa898Stholothe following (all on a single line in `inetd.conf') should be 3842e7fa898Stholosufficient: 3852e7fa898Stholo 3862e7fa898Stholo 2401 stream tcp nowait root /usr/local/bin/cvs 387e77048c1Stholo cvs -f --allow-root=/usr/cvsroot pserver 3882e7fa898Stholo 389f79d7d1bStholo You could also use the `-T' option to specify a temporary directory. 3902e7fa898Stholo 391565bb110Stholo The `--allow-root' option specifies the allowable CVSROOT directory. 392565bb110StholoClients which attempt to use a different CVSROOT directory will not be 393565bb110Stholoallowed to connect. If there is more than one CVSROOT directory which 3942f9d2fd9Stholoyou want to allow, repeat the option. (Unfortunately, many versions of 3952f9d2fd9Stholo`inetd' have very small limits on the number of arguments and/or the 3962f9d2fd9Stholototal length of the command. The usual solution to this problem is to 3972f9d2fd9Stholohave `inetd' run a shell script which then invokes CVS with the 3982f9d2fd9Stholonecessary arguments.) 399565bb110Stholo 4002e7fa898Stholo If your `inetd' wants a symbolic service name instead of a raw port 4012e7fa898Stholonumber, then put this in `/etc/services': 4022e7fa898Stholo 4032e7fa898Stholo cvspserver 2401/tcp 4042e7fa898Stholo 4052e7fa898Stholo and put `cvspserver' instead of `2401' in `inetd.conf'. 4062e7fa898Stholo 4072e7fa898Stholo Once the above is taken care of, restart your `inetd', or do 4082e7fa898Stholowhatever is necessary to force it to reread its initialization files. 4092e7fa898Stholo 4108506102dStholo If you are having trouble setting this up, see *Note Connection::. 4118506102dStholo 4122e7fa898Stholo Because the client stores and transmits passwords in cleartext 4132e7fa898Stholo(almost--see *Note Password authentication security::, for details), a 414e77048c1Stholoseparate CVS password file is generally used, so people don't compromise 415e77048c1Stholotheir regular passwords when they access the repository. This file is 416e77048c1Stholo`$CVSROOT/CVSROOT/passwd' (*note Intro administrative files::). It 417e77048c1Stholouses a colon-separated format, similar to `/etc/passwd' on Unix systems, 418e77048c1Stholoexcept that it has fewer fields: CVS username, optional password, and 419e77048c1Stholoan optional system username for CVS to run as if authentication 420e77048c1Stholosucceeds. Here is an example `passwd' file with five entries: 4212e7fa898Stholo 422e77048c1Stholo anonymous: 4232e7fa898Stholo bach:ULtgRLXo7NRxs 424e77048c1Stholo spwang:1sOp854gDF3DY 425e77048c1Stholo melissa:tGX1fS8sun6rY:pubcvs 426e77048c1Stholo qproj:XR4EZcEs0szik:pubcvs 4272e7fa898Stholo 428e77048c1Stholo (The passwords are encrypted according to the standard Unix 429e77048c1Stholo`crypt()' function, so it is possible to paste in passwords directly 430e77048c1Stholofrom regular Unix `/etc/passwd' files.) 4312e7fa898Stholo 432e77048c1Stholo The first line in the example will grant access to any CVS client 433e77048c1Stholoattempting to authenticate as user `anonymous', no matter what password 434e77048c1Stholothey use, including an empty password. (This is typical for sites 435e77048c1Sthologranting anonymous read-only access; for information on how to do the 436e77048c1Stholo"read-only" part, see *Note Read-only access::.) 4372e7fa898Stholo 438e77048c1Stholo The second and third lines will grant access to `bach' and `spwang' 439e77048c1Stholoif they supply their respective plaintext passwords. 4402e7fa898Stholo 441e77048c1Stholo The fourth line will grant access to `melissa', if she supplies the 442e77048c1Stholocorrect password, but her CVS operations will actually run on the 443e77048c1Stholoserver side under the system user `pubcvs'. Thus, there need not be 444e77048c1Stholoany system user named `melissa', but there _must_ be one named `pubcvs'. 4452e7fa898Stholo 446e77048c1Stholo The fifth line shows that system user identities can be shared: any 447e77048c1Stholoclient who successfully authenticates as `qproj' will actually run as 448e77048c1Stholo`pubcvs', just as `melissa' does. That way you could create a single, 449e77048c1Stholoshared system user for each project in your repository, and give each 450e77048c1Stholodeveloper their own line in the `$CVSROOT/CVSROOT/passwd' file. The CVS 451e77048c1Stholousername on each line would be different, but the system username would 452e77048c1Stholobe the same. The reason to have different CVS usernames is that CVS 453e77048c1Stholowill log their actions under those names: when `melissa' commits a 454e77048c1Stholochange to a project, the checkin is recorded in the project's history 455e77048c1Stholounder the name `melissa', not `pubcvs'. And the reason to have them 456e77048c1Stholoshare a system username is so that you can arrange permissions in the 457e77048c1Stholorelevant area of the repository such that only that account has 458e77048c1Stholowrite-permission there. 4592e7fa898Stholo 460e77048c1Stholo If the system-user field is present, all password-authenticated CVS 461e77048c1Stholocommands run as that user; if no system user is specified, CVS simply 462e77048c1Stholotakes the CVS username as the system username and runs commands as that 463e77048c1Stholouser. In either case, if there is no such user on the system, then the 464e77048c1StholoCVS operation will fail (regardless of whether the client supplied a 465e77048c1Stholovalid password). 4662e7fa898Stholo 467e77048c1Stholo The password and system-user fields can both be omitted (and if the 468e77048c1Stholosystem-user field is omitted, then also omit the colon that would have 469e77048c1Stholoseparated it from the encrypted password). For example, this would be a 470e77048c1Stholovalid `$CVSROOT/CVSROOT/passwd' file: 4712e7fa898Stholo 472e77048c1Stholo anonymous::pubcvs 473e77048c1Stholo fish:rKa5jzULzmhOo:kfogel 474e77048c1Stholo sussman:1sOp854gDF3DY 475e77048c1Stholo 476e77048c1Stholo When the password field is omitted or empty, then the client's 477e77048c1Stholoauthentication attempt will succeed with any password, including the 478e77048c1Stholoempty string. However, the colon after the CVS username is always 479e77048c1Stholonecessary, even if the password is empty. 480e77048c1Stholo 481e77048c1Stholo CVS can also fall back to use system authentication. When 482e77048c1Stholoauthenticating a password, the server first checks for the user in the 483e77048c1Stholo`$CVSROOT/CVSROOT/passwd' file. If it finds the user, it will use that 484e77048c1Stholoentry for authentication as described above. But if it does not find 485e77048c1Stholothe user, or if the CVS `passwd' file does not exist, then the server 486e77048c1Stholocan try to authenticate the username and password using the operating 487e77048c1Stholosystem's user-lookup routines (this "fallback" behavior can be disabled 488e77048c1Stholoby setting `SystemAuth=no' in the CVS `config' file, *note config::). 489e77048c1StholoBe aware, however, that falling back to system authentication might be 490e77048c1Stholoa security risk: CVS operations would then be authenticated with that 491e77048c1Stholouser's regular login password, and the password flies across the 492e77048c1Stholonetwork in plaintext. See *Note Password authentication security:: for 493e77048c1Stholomore on this. 4942e7fa898Stholo 4952e7fa898Stholo Right now, the only way to put a password in the CVS `passwd' file 4962e7fa898Stholois to paste it there from somewhere else. Someday, there may be a `cvs 497e77048c1Stholopasswd' command. 498e77048c1Stholo 499e77048c1Stholo Unlike many of the files in `$CVSROOT/CVSROOT', it is normal to edit 500e77048c1Stholothe `passwd' file in-place, rather than via CVS. This is because of the 501e77048c1Stholopossible security risks of having the `passwd' file checked out to 502e77048c1Stholopeople's working copies. If you do want to include the `passwd' file 503e77048c1Stholoin checkouts of `$CVSROOT/CVSROOT', see *Note checkoutlist::. 5042e7fa898Stholo 5052e7fa898Stholo 5062e7fa898StholoFile: cvs.info, Node: Password authentication client, Next: Password authentication security, Prev: Password authentication server, Up: Password authenticated 5072e7fa898Stholo 5082e7fa898StholoUsing the client with password authentication 5092e7fa898Stholo............................................. 5102e7fa898Stholo 511e77048c1Stholo To run a CVS command on a remote repository via the 512e77048c1Stholopassword-authenticating server, one specifies the `pserver' protocol, 513*43c1707eStholooptional username, repository host, an optional port number, and path 514*43c1707eStholoto the repository. For example: 5152e7fa898Stholo 516*43c1707eStholo cvs -d :pserver:faun.example.org:/usr/local/cvsroot checkout someproj 517e77048c1Stholo 518e77048c1Stholo or 519e77048c1Stholo 520*43c1707eStholo CVSROOT=:pserver:bach@faun.example.org:2401/usr/local/cvsroot 521e77048c1Stholo cvs checkout someproj 522e77048c1Stholo 523e77048c1Stholo However, unless you're connecting to a public-access repository 524e77048c1Stholo(i.e., one where that username doesn't require a password), you'll need 525*43c1707eStholoto supply a password or "log in" first. Logging in verifies your 526*43c1707eStholopassword with the repository and stores it in a file. It's done with 527*43c1707eStholothe `login' command, which will prompt you interactively for the 528*43c1707eStholopassword if you didn't supply one as part of $CVSROOT: 5292e7fa898Stholo 5308506102dStholo cvs -d :pserver:bach@faun.example.org:/usr/local/cvsroot login 5312e7fa898Stholo CVS password: 5322e7fa898Stholo 533*43c1707eStholo or 534*43c1707eStholo 535*43c1707eStholo cvs -d :pserver:bach:p4ss30rd@faun.example.org:/usr/local/cvsroot login 536*43c1707eStholo 537e77048c1Stholo After you enter the password, CVS verifies it with the server. If 538e77048c1Stholothe verification succeeds, then that combination of username, host, 539e77048c1Stholorepository, and password is permanently recorded, so future 540e77048c1Stholotransactions with that repository won't require you to run `cvs login'. 541e77048c1Stholo(If verification fails, CVS will exit complaining that the password 542e77048c1Stholowas incorrect, and nothing will be recorded.) 5432e7fa898Stholo 544e77048c1Stholo The records are stored, by default, in the file `$HOME/.cvspass'. 545e77048c1StholoThat file's format is human-readable, and to a degree human-editable, 546e77048c1Stholobut note that the passwords are not stored in cleartext--they are 547e77048c1Stholotrivially encoded to protect them from "innocent" compromise (i.e., 548e77048c1Stholoinadvertent viewing by a system administrator or other non-malicious 549e77048c1Stholoperson). 550e77048c1Stholo 551e77048c1Stholo You can change the default location of this file by setting the 552e77048c1Stholo`CVS_PASSFILE' environment variable. If you use this variable, make 553e77048c1Stholosure you set it _before_ `cvs login' is run. If you were to set it 554e77048c1Stholoafter running `cvs login', then later CVS commands would be unable to 555e77048c1Sthololook up the password for transmission to the server. 556e77048c1Stholo 557e77048c1Stholo Once you have logged in, all CVS commands using that remote 558e77048c1Stholorepository and username will authenticate with the stored password. 559e77048c1StholoSo, for example 5602e7fa898Stholo 5618506102dStholo cvs -d :pserver:bach@faun.example.org:/usr/local/cvsroot checkout foo 5622e7fa898Stholo 563e77048c1Stholo should just work (unless the password changes on the server side, in 564e77048c1Stholowhich case you'll have to re-run `cvs login'). 5652e7fa898Stholo 566e77048c1Stholo Note that if the `:pserver:' were not present in the repository 567e77048c1Stholospecification, CVS would assume it should use `rsh' to connect with the 568e77048c1Stholoserver instead (*note Connecting via rsh::). 5692e7fa898Stholo 570e77048c1Stholo Of course, once you have a working copy checked out and are running 571e77048c1StholoCVS commands from within it, there is no longer any need to specify the 572e77048c1Stholorepository explicitly, because CVS can deduce the repository from the 573e77048c1Stholoworking copy's `CVS' subdirectory. 5742e7fa898Stholo 575e77048c1Stholo The password for a given remote repository can be removed from the 576e77048c1Stholo`CVS_PASSFILE' by using the `cvs logout' command. 5772e7fa898Stholo 5782e7fa898Stholo 5792e7fa898StholoFile: cvs.info, Node: Password authentication security, Prev: Password authentication client, Up: Password authenticated 5802e7fa898Stholo 5812e7fa898StholoSecurity considerations with password authentication 5822e7fa898Stholo.................................................... 5832e7fa898Stholo 5842e7fa898Stholo The passwords are stored on the client side in a trivial encoding of 5852e7fa898Stholothe cleartext, and transmitted in the same encoding. The encoding is 5862e7fa898Stholodone only to prevent inadvertent password compromises (i.e., a system 5872e7fa898Stholoadministrator accidentally looking at the file), and will not prevent 5882e7fa898Stholoeven a naive attacker from gaining the password. 5892e7fa898Stholo 5902e7fa898Stholo The separate CVS password file (*note Password authentication 591e77048c1Stholoserver::) allows people to use a different password for repository 5922e7fa898Stholoaccess than for login access. On the other hand, once a user has 593f79d7d1bStholonon-read-only access to the repository, she can execute programs on the 594f79d7d1bStholoserver system through a variety of means. Thus, repository access 595f79d7d1bStholoimplies fairly broad system access as well. It might be possible to 596f79d7d1bStholomodify CVS to prevent that, but no one has done so as of this writing. 597f79d7d1bStholo 598f79d7d1bStholo Note that because the `$CVSROOT/CVSROOT' directory contains `passwd' 599f79d7d1bStholoand other files which are used to check security, you must control the 600f79d7d1bStholopermissions on this directory as tightly as the permissions on `/etc'. 601f79d7d1bStholoThe same applies to the `$CVSROOT' directory itself and any directory 602f79d7d1bStholoabove it in the tree. Anyone who has write access to such a directory 603f79d7d1bStholowill have the ability to become any user on the system. Note that 604f79d7d1bStholothese permissions are typically tighter than you would use if you are 605f79d7d1bStholonot using pserver. 6062e7fa898Stholo 6072f9d2fd9Stholo In summary, anyone who gets the password gets repository access 6082f9d2fd9Stholo(which may imply some measure of general system access as well). The 6092f9d2fd9Stholopassword is available to anyone who can sniff network packets or read a 6102f9d2fd9Stholoprotected (i.e., user read-only) file. If you want real security, get 6112f9d2fd9StholoKerberos. 6122e7fa898Stholo 6132e7fa898Stholo 614f79d7d1bStholoFile: cvs.info, Node: GSSAPI authenticated, Next: Kerberos authenticated, Prev: Password authenticated, Up: Remote repositories 615f79d7d1bStholo 616f79d7d1bStholoDirect connection with GSSAPI 617f79d7d1bStholo----------------------------- 618f79d7d1bStholo 619f79d7d1bStholo GSSAPI is a generic interface to network security systems such as 620f79d7d1bStholoKerberos 5. If you have a working GSSAPI library, you can have CVS 621f79d7d1bStholoconnect via a direct TCP connection, authenticating with GSSAPI. 622f79d7d1bStholo 623f79d7d1bStholo To do this, CVS needs to be compiled with GSSAPI support; when 624f79d7d1bStholoconfiguring CVS it tries to detect whether GSSAPI libraries using 625f79d7d1bStholokerberos version 5 are present. You can also use the `--with-gssapi' 626f79d7d1bStholoflag to configure. 627f79d7d1bStholo 628f79d7d1bStholo The connection is authenticated using GSSAPI, but the message stream 6292f9d2fd9Stholois _not_ authenticated by default. You must use the `-a' global option 630f79d7d1bStholoto request stream authentication. 631f79d7d1bStholo 6322f9d2fd9Stholo The data transmitted is _not_ encrypted by default. Encryption 633f79d7d1bStholosupport must be compiled into both the client and the server; use the 634f79d7d1bStholo`--enable-encrypt' configure option to turn it on. You must then use 635f79d7d1bStholothe `-x' global option to request encryption. 636f79d7d1bStholo 637f79d7d1bStholo GSSAPI connections are handled on the server side by the same server 638f79d7d1bStholowhich handles the password authentication server; see *Note Password 639f79d7d1bStholoauthentication server::. If you are using a GSSAPI mechanism such as 640f79d7d1bStholoKerberos which provides for strong authentication, you will probably 641f79d7d1bStholowant to disable the ability to authenticate via cleartext passwords. 642f79d7d1bStholoTo do so, create an empty `CVSROOT/passwd' password file, and set 643e77048c1Stholo`SystemAuth=no' in the config file (*note config::). 644f79d7d1bStholo 645f79d7d1bStholo The GSSAPI server uses a principal name of cvs/HOSTNAME, where 646f79d7d1bStholoHOSTNAME is the canonical name of the server host. You will have to 647f79d7d1bStholoset this up as required by your GSSAPI mechanism. 648f79d7d1bStholo 649f79d7d1bStholo To connect using GSSAPI, use `:gserver:'. For example, 650f79d7d1bStholo 6518506102dStholo cvs -d :gserver:faun.example.org:/usr/local/cvsroot checkout foo 652f79d7d1bStholo 653f79d7d1bStholo 6548506102dStholoFile: cvs.info, Node: Kerberos authenticated, Next: Connecting via fork, Prev: GSSAPI authenticated, Up: Remote repositories 655423f0401Stholo 656423f0401StholoDirect connection with kerberos 657423f0401Stholo------------------------------- 658423f0401Stholo 659f79d7d1bStholo The easiest way to use kerberos is to use the kerberos `rsh', as 660f79d7d1bStholodescribed in *Note Connecting via rsh::. The main disadvantage of 661f79d7d1bStholousing rsh is that all the data needs to pass through additional 662f79d7d1bStholoprograms, so it may be slower. So if you have kerberos installed you 663f79d7d1bStholocan connect via a direct TCP connection, authenticating with kerberos. 664f79d7d1bStholo 665f79d7d1bStholo This section concerns the kerberos network security system, version 666f79d7d1bStholo4. Kerberos version 5 is supported via the GSSAPI generic network 667f79d7d1bStholosecurity interface, as described in the previous section. 668423f0401Stholo 669423f0401Stholo To do this, CVS needs to be compiled with kerberos support; when 670423f0401Stholoconfiguring CVS it tries to detect whether kerberos is present or you 671423f0401Stholocan use the `--with-krb4' flag to configure. 672423f0401Stholo 6732f9d2fd9Stholo The data transmitted is _not_ encrypted by default. Encryption 674423f0401Stholosupport must be compiled into both the client and server; use the 675423f0401Stholo`--enable-encryption' configure option to turn it on. You must then 676423f0401Stholouse the `-x' global option to request encryption. 677423f0401Stholo 678423f0401Stholo You need to edit `inetd.conf' on the server machine to run `cvs 679423f0401Stholokserver'. The client uses port 1999 by default; if you want to use 680*43c1707eStholoanother port specify it in the `CVSROOT' (*note Remote repositories::) 681*43c1707eStholoor the `CVS_CLIENT_PORT' environment variable on the client. 682423f0401Stholo 683423f0401Stholo When you want to use CVS, get a ticket in the usual way (generally 684423f0401Stholo`kinit'); it must be a ticket which allows you to log into the server 685423f0401Stholomachine. Then you are ready to go: 686423f0401Stholo 6878506102dStholo cvs -d :kserver:faun.example.org:/usr/local/cvsroot checkout foo 688423f0401Stholo 689423f0401Stholo Previous versions of CVS would fall back to a connection via rsh; 690423f0401Stholothis version will not do so. 691423f0401Stholo 692423f0401Stholo 6938506102dStholoFile: cvs.info, Node: Connecting via fork, Prev: Kerberos authenticated, Up: Remote repositories 6948506102dStholo 6958506102dStholoConnecting with fork 6968506102dStholo-------------------- 6978506102dStholo 6988506102dStholo This access method allows you to connect to a repository on your 6998506102dSthololocal disk via the remote protocol. In other words it does pretty much 7008506102dStholothe same thing as `:local:', but various quirks, bugs and the like are 7018506102dStholothose of the remote CVS rather than the local CVS. 7028506102dStholo 7038506102dStholo For day-to-day operations you might prefer either `:local:' or 7048506102dStholo`:fork:', depending on your preferences. Of course `:fork:' comes in 7058506102dStholoparticularly handy in testing or debugging `cvs' and the remote 7068506102dStholoprotocol. Specifically, we avoid all of the network-related 7078506102dStholosetup/configuration, timeouts, and authentication inherent in the other 7088506102dStholoremote access methods but still create a connection which uses the 7098506102dStholoremote protocol. 7108506102dStholo 7118506102dStholo To connect using the `fork' method, use `:fork:' and the pathname to 7128506102dStholoyour local repository. For example: 7138506102dStholo 7148506102dStholo cvs -d :fork:/usr/local/cvsroot checkout foo 7158506102dStholo 7168506102dStholo As with `:ext:', the server is called `cvs' by default, or the value 7178506102dStholoof the `CVS_SERVER' environment variable. 7188506102dStholo 7198506102dStholo 720565bb110StholoFile: cvs.info, Node: Read-only access, Next: Server temporary directory, Prev: Remote repositories, Up: Repository 721423f0401Stholo 722423f0401StholoRead-only repository access 723423f0401Stholo=========================== 724423f0401Stholo 725423f0401Stholo It is possible to grant read-only repository access to people using 726e77048c1Stholothe password-authenticated server (*note Password authenticated::). 727423f0401Stholo(The other access methods do not have explicit support for read-only 728423f0401Stholousers because those methods all assume login access to the repository 729423f0401Stholomachine anyway, and therefore the user can do whatever local file 730423f0401Stholopermissions allow her to do.) 731423f0401Stholo 732423f0401Stholo A user who has read-only access can do only those CVS operations 733423f0401Stholowhich do not modify the repository, except for certain "administrative" 734423f0401Stholofiles (such as lock files and the history file). It may be desirable 735423f0401Stholoto use this feature in conjunction with user-aliasing (*note Password 736e77048c1Stholoauthentication server::). 737f79d7d1bStholo 738f79d7d1bStholo Unlike with previous versions of CVS, read-only users should be able 739f79d7d1bStholomerely to read the repository, and not to execute programs on the 740f79d7d1bStholoserver or otherwise gain unexpected levels of access. Or to be more 7412f9d2fd9Stholoaccurate, the _known_ holes have been plugged. Because this feature is 742f79d7d1bStholonew and has not received a comprehensive security audit, you should use 743f79d7d1bStholowhatever level of caution seems warranted given your attitude concerning 744f79d7d1bStholosecurity. 745423f0401Stholo 746423f0401Stholo There are two ways to specify read-only access for a user: by 747423f0401Stholoinclusion, and by exclusion. 748423f0401Stholo 749423f0401Stholo "Inclusion" means listing that user specifically in the 750423f0401Stholo`$CVSROOT/CVSROOT/readers' file, which is simply a newline-separated 751423f0401Sthololist of users. Here is a sample `readers' file: 752423f0401Stholo 753423f0401Stholo melissa 754423f0401Stholo splotnik 755423f0401Stholo jrandom 756423f0401Stholo 757423f0401Stholo (Don't forget the newline after the last user.) 758423f0401Stholo 7592f9d2fd9Stholo "Exclusion" means explicitly listing everyone who has _write_ 760565bb110Stholoaccess--if the file 761423f0401Stholo 762565bb110Stholo $CVSROOT/CVSROOT/writers 763565bb110Stholo 764565bb110Stholoexists, then only those users listed in it have write access, and 765565bb110Stholoeveryone else has read-only access (of course, even the read-only users 766565bb110Stholostill need to be listed in the CVS `passwd' file). The `writers' file 767565bb110Stholohas the same format as the `readers' file. 768565bb110Stholo 769565bb110Stholo Note: if your CVS `passwd' file maps cvs users onto system users 770e77048c1Stholo(*note Password authentication server::), make sure you deny or grant 7712f9d2fd9Stholoread-only access using the _cvs_ usernames, not the system usernames. 772565bb110StholoThat is, the `readers' and `writers' files contain cvs usernames, which 773565bb110Stholomay or may not be the same as system usernames. 774423f0401Stholo 775423f0401Stholo Here is a complete description of the server's behavior in deciding 776423f0401Stholowhether to grant read-only or read-write access: 777423f0401Stholo 778423f0401Stholo If `readers' exists, and this user is listed in it, then she gets 779423f0401Stholoread-only access. Or if `writers' exists, and this user is NOT listed 780423f0401Stholoin it, then she also gets read-only access (this is true even if 781423f0401Stholo`readers' exists but she is not listed there). Otherwise, she gets 782423f0401Stholofull read-write access. 783423f0401Stholo 784423f0401Stholo Of course there is a conflict if the user is listed in both files. 785423f0401StholoThis is resolved in the more conservative way, it being better to 786423f0401Stholoprotect the repository too much than too little: such a user gets 787423f0401Stholoread-only access. 788423f0401Stholo 789423f0401Stholo 790565bb110StholoFile: cvs.info, Node: Server temporary directory, Prev: Read-only access, Up: Repository 791565bb110Stholo 792565bb110StholoTemporary directories for the server 793565bb110Stholo==================================== 794565bb110Stholo 795565bb110Stholo While running, the CVS server creates temporary directories. They 796565bb110Stholoare named 797565bb110Stholo 798565bb110Stholo cvs-servPID 799565bb110Stholo 800565bb110Stholowhere PID is the process identification number of the server. They are 801565bb110Sthololocated in the directory specified by the `TMPDIR' environment variable 802e77048c1Stholo(*note Environment variables::), the `-T' global option (*note Global 803e77048c1Stholooptions::), or failing that `/tmp'. 804565bb110Stholo 805565bb110Stholo In most cases the server will remove the temporary directory when it 806565bb110Stholois done, whether it finishes normally or abnormally. However, there 807565bb110Stholoare a few cases in which the server does not or cannot remove the 808565bb110Stholotemporary directory, for example: 809565bb110Stholo 810565bb110Stholo * If the server aborts due to an internal server error, it may 811565bb110Stholo preserve the directory to aid in debugging 812565bb110Stholo 813565bb110Stholo * If the server is killed in a way that it has no way of cleaning up 814565bb110Stholo (most notably, `kill -KILL' on unix). 815565bb110Stholo 816565bb110Stholo * If the system shuts down without an orderly shutdown, which tells 817565bb110Stholo the server to clean up. 818565bb110Stholo 819565bb110Stholo In cases such as this, you will need to manually remove the 820565bb110Stholo`cvs-servPID' directories. As long as there is no server running with 821565bb110Stholoprocess identification number PID, it is safe to do so. 822565bb110Stholo 823565bb110Stholo 824f79d7d1bStholoFile: cvs.info, Node: Starting a new project, Next: Revisions, Prev: Repository, Up: Top 825423f0401Stholo 826423f0401StholoStarting a project with CVS 827423f0401Stholo*************************** 828423f0401Stholo 829423f0401Stholo Because renaming files and moving them between directories is 830423f0401Stholosomewhat inconvenient, the first thing you do when you start a new 831423f0401Stholoproject should be to think through your file organization. It is not 832423f0401Stholoimpossible to rename or move files, but it does increase the potential 833423f0401Stholofor confusion and CVS does have some quirks particularly in the area of 834423f0401Stholorenaming directories. *Note Moving files::. 835423f0401Stholo 836423f0401Stholo What to do next depends on the situation at hand. 837423f0401Stholo 838423f0401Stholo* Menu: 839423f0401Stholo 840423f0401Stholo* Setting up the files:: Getting the files into the repository 841423f0401Stholo* Defining the module:: How to make a module of the files 842423f0401Stholo 843423f0401Stholo 8447db08293StholoFile: cvs.info, Node: Setting up the files, Next: Defining the module, Up: Starting a new project 8457db08293Stholo 8467db08293StholoSetting up the files 8477db08293Stholo==================== 8487db08293Stholo 8497db08293Stholo The first step is to create the files inside the repository. This 8507db08293Stholocan be done in a couple of different ways. 8517db08293Stholo 8527db08293Stholo* Menu: 8537db08293Stholo 8547db08293Stholo* From files:: This method is useful with old projects 8557db08293Stholo where files already exists. 8567db08293Stholo* From other version control systems:: Old projects where you want to 8577db08293Stholo preserve history from another system. 8587db08293Stholo* From scratch:: Creating a directory tree from scratch. 8597db08293Stholo 8607db08293Stholo 8617db08293StholoFile: cvs.info, Node: From files, Next: From other version control systems, Up: Setting up the files 8627db08293Stholo 8637db08293StholoCreating a directory tree from a number of files 8647db08293Stholo------------------------------------------------ 8657db08293Stholo 8667db08293Stholo When you begin using CVS, you will probably already have several 8677db08293Stholoprojects that can be put under CVS control. In these cases the easiest 8687db08293Stholoway is to use the `import' command. An example is probably the easiest 8697db08293Stholoway to explain how to use it. If the files you want to install in CVS 8707db08293Stholoreside in `WDIR', and you want them to appear in the repository as 8717db08293Stholo`$CVSROOT/yoyodyne/RDIR', you can do this: 8727db08293Stholo 8737db08293Stholo $ cd WDIR 8747db08293Stholo $ cvs import -m "Imported sources" yoyodyne/RDIR yoyo start 8757db08293Stholo 8767db08293Stholo Unless you supply a log message with the `-m' flag, CVS starts an 8777db08293Stholoeditor and prompts for a message. The string `yoyo' is a "vendor tag", 8787db08293Stholoand `start' is a "release tag". They may fill no purpose in this 8797db08293Stholocontext, but since CVS requires them they must be present. *Note 8807db08293StholoTracking sources::, for more information about them. 8817db08293Stholo 8827db08293Stholo You can now verify that it worked, and remove your original source 8837db08293Stholodirectory. 8847db08293Stholo 8857db08293Stholo $ cd .. 886e77048c1Stholo $ cvs checkout yoyodyne/RDIR # Explanation below 887e77048c1Stholo $ diff -r WDIR yoyodyne/RDIR 888e77048c1Stholo $ rm -r WDIR 8897db08293Stholo 8907db08293StholoErasing the original sources is a good idea, to make sure that you do 891e77048c1Stholonot accidentally edit them in WDIR, bypassing CVS. Of course, it would 8927db08293Stholobe wise to make sure that you have a backup of the sources before you 8937db08293Stholoremove them. 8947db08293Stholo 8957db08293Stholo The `checkout' command can either take a module name as argument (as 8967db08293Stholoit has done in all previous examples) or a path name relative to 8977db08293Stholo`$CVSROOT', as it did in the example above. 8987db08293Stholo 8997db08293Stholo It is a good idea to check that the permissions CVS sets on the 9007db08293Stholodirectories inside `$CVSROOT' are reasonable, and that they belong to 9017db08293Stholothe proper groups. *Note File permissions::. 9027db08293Stholo 9037db08293Stholo If some of the files you want to import are binary, you may want to 9047db08293Stholouse the wrappers features to specify which files are binary and which 9057db08293Stholoare not. *Note Wrappers::. 9067db08293Stholo 9077db08293Stholo 9087db08293StholoFile: cvs.info, Node: From other version control systems, Next: From scratch, Prev: From files, Up: Setting up the files 9097db08293Stholo 9107db08293StholoCreating Files From Other Version Control Systems 9117db08293Stholo------------------------------------------------- 9127db08293Stholo 9137db08293Stholo If you have a project which you are maintaining with another version 9147db08293Stholocontrol system, such as RCS, you may wish to put the files from that 9157db08293Stholoproject into CVS, and preserve the revision history of the files. 9167db08293Stholo 9177db08293StholoFrom RCS 9187db08293Stholo If you have been using RCS, find the RCS files--usually a file 9197db08293Stholo named `foo.c' will have its RCS file in `RCS/foo.c,v' (but it 9207db08293Stholo could be other places; consult the RCS documentation for details). 9217db08293Stholo Then create the appropriate directories in CVS if they do not 9227db08293Stholo already exist. Then copy the files into the appropriate 9237db08293Stholo directories in the CVS repository (the name in the repository must 9247db08293Stholo be the name of the source file with `,v' added; the files go 9258506102dStholo directly in the appropriate directory of the repository, not in an 9267db08293Stholo `RCS' subdirectory). This is one of the few times when it is a 9277db08293Stholo good idea to access the CVS repository directly, rather than using 9287db08293Stholo CVS commands. Then you are ready to check out a new working 9297db08293Stholo directory. 9307db08293Stholo 9317db08293Stholo The RCS file should not be locked when you move it into CVS; if it 9327db08293Stholo is, CVS will have trouble letting you operate on it. 9337db08293Stholo 9347db08293StholoFrom another version control system 9357db08293Stholo Many version control systems have the ability to export RCS files 9367db08293Stholo in the standard format. If yours does, export the RCS files and 9377db08293Stholo then follow the above instructions. 9387db08293Stholo 939f79d7d1bStholo Failing that, probably your best bet is to write a script that 940f79d7d1bStholo will check out the files one revision at a time using the command 941f79d7d1bStholo line interface to the other system, and then check the revisions 942f79d7d1bStholo into CVS. The `sccs2rcs' script mentioned below may be a useful 943f79d7d1bStholo example to follow. 944f79d7d1bStholo 9457db08293StholoFrom SCCS 9467db08293Stholo There is a script in the `contrib' directory of the CVS source 9477db08293Stholo distribution called `sccs2rcs' which converts SCCS files to RCS 9487db08293Stholo files. Note: you must run it on a machine which has both SCCS and 9497db08293Stholo RCS installed, and like everything else in contrib it is 9507db08293Stholo unsupported (your mileage may vary). 9517db08293Stholo 952f79d7d1bStholoFrom PVCS 953f79d7d1bStholo There is a script in the `contrib' directory of the CVS source 954f79d7d1bStholo distribution called `pvcs_to_rcs' which converts PVCS archives to 955f79d7d1bStholo RCS files. You must run it on a machine which has both PVCS and 956f79d7d1bStholo RCS installed, and like everything else in contrib it is 957f79d7d1bStholo unsupported (your mileage may vary). See the comments in the 958f79d7d1bStholo script for details. 959f79d7d1bStholo 9607db08293Stholo 9617db08293StholoFile: cvs.info, Node: From scratch, Prev: From other version control systems, Up: Setting up the files 9627db08293Stholo 9637db08293StholoCreating a directory tree from scratch 9647db08293Stholo-------------------------------------- 9657db08293Stholo 9667db08293Stholo For a new project, the easiest thing to do is probably to create an 9677db08293Stholoempty directory structure, like this: 9687db08293Stholo 9697db08293Stholo $ mkdir tc 9707db08293Stholo $ mkdir tc/man 9717db08293Stholo $ mkdir tc/testing 9727db08293Stholo 9737db08293Stholo After that, you use the `import' command to create the corresponding 9747db08293Stholo(empty) directory structure inside the repository: 9757db08293Stholo 9767db08293Stholo $ cd tc 9777db08293Stholo $ cvs import -m "Created directory structure" yoyodyne/DIR yoyo start 9787db08293Stholo 9797db08293Stholo Then, use `add' to add files (and new directories) as they appear. 9807db08293Stholo 9817db08293Stholo Check that the permissions CVS sets on the directories inside 9827db08293Stholo`$CVSROOT' are reasonable. 9837db08293Stholo 9847db08293Stholo 9857db08293StholoFile: cvs.info, Node: Defining the module, Prev: Setting up the files, Up: Starting a new project 9867db08293Stholo 9877db08293StholoDefining the module 9887db08293Stholo=================== 9897db08293Stholo 9907db08293Stholo The next step is to define the module in the `modules' file. This 9917db08293Stholois not strictly necessary, but modules can be convenient in grouping 9927db08293Stholotogether related files and directories. 9937db08293Stholo 9947db08293Stholo In simple cases these steps are sufficient to define a module. 9957db08293Stholo 9967db08293Stholo 1. Get a working copy of the modules file. 9977db08293Stholo 9987db08293Stholo $ cvs checkout CVSROOT/modules 9997db08293Stholo $ cd CVSROOT 10007db08293Stholo 10017db08293Stholo 2. Edit the file and insert a line that defines the module. *Note 10027db08293Stholo Intro administrative files::, for an introduction. *Note 10037db08293Stholo modules::, for a full description of the modules file. You can 10047db08293Stholo use the following line to define the module `tc': 10057db08293Stholo 10067db08293Stholo tc yoyodyne/tc 10077db08293Stholo 10087db08293Stholo 3. Commit your changes to the modules file. 10097db08293Stholo 10107db08293Stholo $ cvs commit -m "Added the tc module." modules 10117db08293Stholo 10127db08293Stholo 4. Release the modules module. 10137db08293Stholo 10147db08293Stholo $ cd .. 10157db08293Stholo $ cvs release -d CVSROOT 10167db08293Stholo 10177db08293Stholo 1018f79d7d1bStholoFile: cvs.info, Node: Revisions, Next: Branching and merging, Prev: Starting a new project, Up: Top 10197db08293Stholo 1020f79d7d1bStholoRevisions 1021f79d7d1bStholo********* 10227db08293Stholo 1023f79d7d1bStholo For many uses of CVS, one doesn't need to worry too much about 1024f79d7d1bStholorevision numbers; CVS assigns numbers such as `1.1', `1.2', and so on, 1025f79d7d1bStholoand that is all one needs to know. However, some people prefer to have 1026f79d7d1bStholomore knowledge and control concerning how CVS assigns revision numbers. 10277db08293Stholo 1028f79d7d1bStholo If one wants to keep track of a set of revisions involving more than 1029f79d7d1bStholoone file, such as which revisions went into a particular release, one 1030f79d7d1bStholouses a "tag", which is a symbolic revision which can be assigned to a 1031f79d7d1bStholonumeric revision in each file. 10327db08293Stholo 10337db08293Stholo* Menu: 10347db08293Stholo 1035f79d7d1bStholo* Revision numbers:: The meaning of a revision number 1036f79d7d1bStholo* Versions revisions releases:: Terminology used in this manual 1037f79d7d1bStholo* Assigning revisions:: Assigning revisions 10382f9d2fd9Stholo* Tags:: Tags--Symbolic revisions 10398506102dStholo* Tagging the working directory:: The cvs tag command 10408506102dStholo* Tagging by date/tag:: The cvs rtag command 10418506102dStholo* Modifying tags:: Adding, renaming, and deleting tags 10428506102dStholo* Tagging add/remove:: Tags with adding and removing files 1043f79d7d1bStholo* Sticky tags:: Certain tags are persistent 10447db08293Stholo 10457db08293Stholo 1046f79d7d1bStholoFile: cvs.info, Node: Revision numbers, Next: Versions revisions releases, Up: Revisions 10475af5dd31Stholo 1048f79d7d1bStholoRevision numbers 1049f79d7d1bStholo================ 1050f79d7d1bStholo 1051f79d7d1bStholo Each version of a file has a unique "revision number". Revision 1052f79d7d1bStholonumbers look like `1.1', `1.2', `1.3.2.2' or even `1.3.2.2.4.5'. A 1053f79d7d1bStholorevision number always has an even number of period-separated decimal 1054f79d7d1bStholointegers. By default revision 1.1 is the first revision of a file. 1055f79d7d1bStholoEach successive revision is given a new number by increasing the 1056f79d7d1bStholorightmost number by one. The following figure displays a few 1057f79d7d1bStholorevisions, with newer revisions to the right. 1058f79d7d1bStholo 1059f79d7d1bStholo +-----+ +-----+ +-----+ +-----+ +-----+ 1060f79d7d1bStholo ! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 ! 1061f79d7d1bStholo +-----+ +-----+ +-----+ +-----+ +-----+ 1062f79d7d1bStholo 1063f79d7d1bStholo It is also possible to end up with numbers containing more than one 1064f79d7d1bStholoperiod, for example `1.3.2.2'. Such revisions represent revisions on 1065e77048c1Stholobranches (*note Branching and merging::); such revision numbers are 1066f79d7d1bStholoexplained in detail in *Note Branches and revisions::. 1067f79d7d1bStholo 1068f79d7d1bStholo 1069f79d7d1bStholoFile: cvs.info, Node: Versions revisions releases, Next: Assigning revisions, Prev: Revision numbers, Up: Revisions 1070f79d7d1bStholo 1071f79d7d1bStholoVersions, revisions and releases 1072f79d7d1bStholo================================ 1073f79d7d1bStholo 1074f79d7d1bStholo A file can have several versions, as described above. Likewise, a 1075f79d7d1bStholosoftware product can have several versions. A software product is 1076f79d7d1bStholooften given a version number such as `4.1.1'. 1077f79d7d1bStholo 1078f79d7d1bStholo Versions in the first sense are called "revisions" in this document, 1079f79d7d1bStholoand versions in the second sense are called "releases". To avoid 1080f79d7d1bStholoconfusion, the word "version" is almost never used in this document. 1081f79d7d1bStholo 1082f79d7d1bStholo 1083f79d7d1bStholoFile: cvs.info, Node: Assigning revisions, Next: Tags, Prev: Versions revisions releases, Up: Revisions 1084f79d7d1bStholo 1085f79d7d1bStholoAssigning revisions 1086f79d7d1bStholo=================== 1087f79d7d1bStholo 1088f79d7d1bStholo By default, CVS will assign numeric revisions by leaving the first 1089f79d7d1bStholonumber the same and incrementing the second number. For example, 1090f79d7d1bStholo`1.1', `1.2', `1.3', etc. 1091f79d7d1bStholo 1092f79d7d1bStholo When adding a new file, the second number will always be one and the 1093f79d7d1bStholofirst number will equal the highest first number of any file in that 1094f79d7d1bStholodirectory. For example, the current directory contains files whose 1095f79d7d1bStholohighest numbered revisions are `1.7', `3.1', and `4.12', then an added 1096f79d7d1bStholofile will be given the numeric revision `4.1'. 1097f79d7d1bStholo 1098f79d7d1bStholo Normally there is no reason to care about the revision numbers--it 1099f79d7d1bStholois easier to treat them as internal numbers that CVS maintains, and tags 1100f79d7d1bStholoprovide a better way to distinguish between things like release 1 1101e77048c1Stholoversus release 2 of your product (*note Tags::). However, if you want 1102f79d7d1bStholoto set the numeric revisions, the `-r' option to `cvs commit' can do 1103f79d7d1bStholothat. The `-r' option implies the `-f' option, in the sense that it 1104f79d7d1bStholocauses the files to be committed even if they are not modified. 1105f79d7d1bStholo 1106f79d7d1bStholo For example, to bring all your files up to revision 3.0 (including 1107f79d7d1bStholothose that haven't changed), you might invoke: 1108f79d7d1bStholo 1109f79d7d1bStholo $ cvs commit -r 3.0 1110f79d7d1bStholo 1111f79d7d1bStholo Note that the number you specify with `-r' must be larger than any 1112f79d7d1bStholoexisting revision number. That is, if revision 3.0 exists, you cannot 1113f79d7d1bStholo`cvs commit -r 1.3'. If you want to maintain several releases in 1114e77048c1Stholoparallel, you need to use a branch (*note Branching and merging::). 1115f79d7d1bStholo 1116