home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Exec 5 / CD_Magazyn_EXEC_nr_5.iso / Programy / Programowanie / cvs-1.11.lha / cvs-1.11 / doc / cvs.info-2 < prev    next >
Encoding:
GNU Info File  |  2000-09-19  |  47.6 KB  |  1,103 lines

  1. This is cvs.info, produced by makeinfo version 4.0 from ./cvs.texinfo.
  2.  
  3. START-INFO-DIR-ENTRY
  4. * CVS: (cvs).          Concurrent Versions System
  5. END-INFO-DIR-ENTRY
  6.  
  7.    Copyright (C) 1992, 1993 Signum Support AB Copyright (C) 1993, 1994
  8. Free Software Foundation, Inc.
  9.  
  10.    Permission is granted to make and distribute verbatim copies of this
  11. manual provided the copyright notice and this permission notice are
  12. preserved on all copies.
  13.  
  14.    Permission is granted to copy and distribute modified versions of
  15. this manual under the conditions for verbatim copying, provided also
  16. that the entire resulting derived work is distributed under the terms
  17. of a permission notice identical to this one.
  18.  
  19.    Permission is granted to copy and distribute translations of this
  20. manual into another language, under the above conditions for modified
  21. versions, except that this permission notice may be stated in a
  22. translation approved by the Free Software Foundation.
  23.  
  24. 
  25. File: cvs.info,  Node: Intro administrative files,  Next: Multiple repositories,  Prev: Working directory storage,  Up: Repository
  26.  
  27. The administrative files
  28. ========================
  29.  
  30.    The directory `$CVSROOT/CVSROOT' contains some "administrative
  31. files".  *Note Administrative files::, for a complete description.  You
  32. can use CVS without any of these files, but some commands work better
  33. when at least the `modules' file is properly set up.
  34.  
  35.    The most important of these files is the `modules' file.  It defines
  36. all modules in the repository.  This is a sample `modules' file.
  37.  
  38.      CVSROOT         CVSROOT
  39.      modules         CVSROOT modules
  40.      cvs             gnu/cvs
  41.      rcs             gnu/rcs
  42.      diff            gnu/diff
  43.      tc              yoyodyne/tc
  44.  
  45.    The `modules' file is line oriented.  In its simplest form each line
  46. contains the name of the module, whitespace, and the directory where
  47. the module resides.  The directory is a path relative to `$CVSROOT'.
  48. The last four lines in the example above are examples of such lines.
  49.  
  50.    The line that defines the module called `modules' uses features that
  51. are not explained here.  *Note modules::, for a full explanation of all
  52. the available features.
  53.  
  54. Editing administrative files
  55. ----------------------------
  56.  
  57.    You edit the administrative files in the same way that you would edit
  58. any other module.  Use `cvs checkout CVSROOT' to get a working copy,
  59. edit it, and commit your changes in the normal way.
  60.  
  61.    It is possible to commit an erroneous administrative file.  You can
  62. often fix the error and check in a new revision, but sometimes a
  63. particularly bad error in the administrative file makes it impossible
  64. to commit new revisions.
  65.  
  66. 
  67. File: cvs.info,  Node: Multiple repositories,  Next: Creating a repository,  Prev: Intro administrative files,  Up: Repository
  68.  
  69. Multiple repositories
  70. =====================
  71.  
  72.    In some situations it is a good idea to have more than one
  73. repository, for instance if you have two development groups that work
  74. on separate projects without sharing any code.  All you have to do to
  75. have several repositories is to specify the appropriate repository,
  76. using the `CVSROOT' environment variable, the `-d' option to CVS, or
  77. (once you have checked out a working directory) by simply allowing CVS
  78. to use the repository that was used to check out the working directory
  79. (*note Specifying a repository::).
  80.  
  81.    The big advantage of having multiple repositories is that they can
  82. reside on different servers.  With CVS version 1.10, a single command
  83. cannot recurse into directories from different repositories.  With
  84. development versions of CVS, you can check out code from multiple
  85. servers into your working directory.  CVS will recurse and handle all
  86. the details of making connections to as many server machines as
  87. necessary to perform the requested command.  Here is an example of how
  88. to set up a working directory:
  89.  
  90.      cvs -d server1:/cvs co dir1
  91.      cd dir1
  92.      cvs -d server2:/root co sdir
  93.      cvs update
  94.  
  95.    The `cvs co' commands set up the working directory, and then the
  96. `cvs update' command will contact server2, to update the dir1/sdir
  97. subdirectory, and server1, to update everything else.
  98.  
  99. 
  100. File: cvs.info,  Node: Creating a repository,  Next: Backing up,  Prev: Multiple repositories,  Up: Repository
  101.  
  102. Creating a repository
  103. =====================
  104.  
  105.    To set up a CVS repository, first choose the machine and disk on
  106. which you want to store the revision history of the source files.  CPU
  107. and memory requirements are modest, so most machines should be
  108. adequate.  For details see *Note Server requirements::.
  109.  
  110.    To estimate disk space requirements, if you are importing RCS files
  111. from another system, the size of those files is the approximate initial
  112. size of your repository, or if you are starting without any version
  113. history, a rule of thumb is to allow for the server approximately three
  114. times the size of the code to be under CVS for the repository (you will
  115. eventually outgrow this, but not for a while).  On the machines on
  116. which the developers will be working, you'll want disk space for
  117. approximately one working directory for each developer (either the
  118. entire tree or a portion of it, depending on what each developer uses).
  119.  
  120.    The repository should be accessible (directly or via a networked
  121. file system) from all machines which want to use CVS in server or local
  122. mode; the client machines need not have any access to it other than via
  123. the CVS protocol.  It is not possible to use CVS to read from a
  124. repository which one only has read access to; CVS needs to be able to
  125. create lock files (*note Concurrency::).
  126.  
  127.    To create a repository, run the `cvs init' command.  It will set up
  128. an empty repository in the CVS root specified in the usual way (*note
  129. Repository::).  For example,
  130.  
  131.      cvs -d /usr/local/cvsroot init
  132.  
  133.    `cvs init' is careful to never overwrite any existing files in the
  134. repository, so no harm is done if you run `cvs init' on an already
  135. set-up repository.
  136.  
  137.    `cvs init' will enable history logging; if you don't want that,
  138. remove the history file after running `cvs init'.  *Note history file::.
  139.  
  140. 
  141. File: cvs.info,  Node: Backing up,  Next: Moving a repository,  Prev: Creating a repository,  Up: Repository
  142.  
  143. Backing up a repository
  144. =======================
  145.  
  146.    There is nothing particularly magical about the files in the
  147. repository; for the most part it is possible to back them up just like
  148. any other files.  However, there are a few issues to consider.
  149.  
  150.    The first is that to be paranoid, one should either not use CVS
  151. during the backup, or have the backup program lock CVS while doing the
  152. backup.  To not use CVS, you might forbid logins to machines which can
  153. access the repository, turn off your CVS server, or similar mechanisms.
  154. The details would depend on your operating system and how you have CVS
  155. set up.  To lock CVS, you would create `#cvs.rfl' locks in each
  156. repository directory.  See *Note Concurrency::, for more on CVS locks.
  157. Having said all this, if you just back up without any of these
  158. precautions, the results are unlikely to be particularly dire.
  159. Restoring from backup, the repository might be in an inconsistent
  160. state, but this would not be particularly hard to fix manually.
  161.  
  162.    When you restore a repository from backup, assuming that changes in
  163. the repository were made after the time of the backup, working
  164. directories which were not affected by the failure may refer to
  165. revisions which no longer exist in the repository.  Trying to run CVS
  166. in such directories will typically produce an error message.  One way
  167. to get those changes back into the repository is as follows:
  168.  
  169.    * Get a new working directory.
  170.  
  171.    * Copy the files from the working directory from before the failure
  172.      over to the new working directory (do not copy the contents of the
  173.      `CVS' directories, of course).
  174.  
  175.    * Working in the new working directory, use commands such as `cvs
  176.      update' and `cvs diff' to figure out what has changed, and then
  177.      when you are ready, commit the changes into the repository.
  178.  
  179. 
  180. File: cvs.info,  Node: Moving a repository,  Next: Remote repositories,  Prev: Backing up,  Up: Repository
  181.  
  182. Moving a repository
  183. ===================
  184.  
  185.    Just as backing up the files in the repository is pretty much like
  186. backing up any other files, if you need to move a repository from one
  187. place to another it is also pretty much like just moving any other
  188. collection of files.
  189.  
  190.    The main thing to consider is that working directories point to the
  191. repository.  The simplest way to deal with a moved repository is to
  192. just get a fresh working directory after the move.  Of course, you'll
  193. want to make sure that the old working directory had been checked in
  194. before the move, or you figured out some other way to make sure that
  195. you don't lose any changes.  If you really do want to reuse the existing
  196. working directory, it should be possible with manual surgery on the
  197. `CVS/Repository' files.  You can see *Note Working directory storage::,
  198. for information on the `CVS/Repository' and `CVS/Root' files, but
  199. unless you are sure you want to bother, it probably isn't worth it.
  200.  
  201. 
  202. File: cvs.info,  Node: Remote repositories,  Next: Read-only access,  Prev: Moving a repository,  Up: Repository
  203.  
  204. Remote repositories
  205. ===================
  206.  
  207.    Your working copy of the sources can be on a different machine than
  208. the repository.  Using CVS in this manner is known as "client/server"
  209. operation.  You run CVS on a machine which can mount your working
  210. directory, known as the "client", and tell it to communicate to a
  211. machine which can mount the repository, known as the "server".
  212. Generally, using a remote repository is just like using a local one,
  213. except that the format of the repository name is:
  214.  
  215.      :METHOD:USER@HOSTNAME:/path/to/repository
  216.  
  217.    The details of exactly what needs to be set up depend on how you are
  218. connecting to the server.
  219.  
  220.    If METHOD is not specified, and the repository name contains `:',
  221. then the default is `ext' or `server', depending on your platform; both
  222. are described in *Note Connecting via rsh::.
  223.  
  224. * Menu:
  225.  
  226. * Server requirements::         Memory and other resources for servers
  227. * Connecting via rsh::          Using the `rsh' program to connect
  228. * Password authenticated::      Direct connections using passwords
  229. * GSSAPI authenticated::        Direct connections using GSSAPI
  230. * Kerberos authenticated::      Direct connections with kerberos
  231. * Connecting via fork::         Using a forked `cvs server' to connect
  232.  
  233. 
  234. File: cvs.info,  Node: Server requirements,  Next: Connecting via rsh,  Up: Remote repositories
  235.  
  236. Server requirements
  237. -------------------
  238.  
  239.    The quick answer to what sort of machine is suitable as a server is
  240. that requirements are modest--a server with 32M of memory or even less
  241. can handle a fairly large source tree with a fair amount of activity.
  242.  
  243.    The real answer, of course, is more complicated.  Estimating the
  244. known areas of large memory consumption should be sufficient to
  245. estimate memory requirements.  There are two such areas documented
  246. here; other memory consumption should be small by comparison (if you
  247. find that is not the case, let us know, as described in *Note BUGS::,
  248. so we can update this documentation).
  249.  
  250.    The first area of big memory consumption is large checkouts, when
  251. using the CVS server.  The server consists of two processes for each
  252. client that it is serving.  Memory consumption on the child process
  253. should remain fairly small.  Memory consumption on the parent process,
  254. particularly if the network connection to the client is slow, can be
  255. expected to grow to slightly more than the size of the sources in a
  256. single directory, or two megabytes, whichever is larger.
  257.  
  258.    Multiplying the size of each CVS server by the number of servers
  259. which you expect to have active at one time should give an idea of
  260. memory requirements for the server.  For the most part, the memory
  261. consumed by the parent process probably can be swap space rather than
  262. physical memory.
  263.  
  264.    The second area of large memory consumption is `diff', when checking
  265. in large files.  This is required even for binary files.  The rule of
  266. thumb is to allow about ten times the size of the largest file you will
  267. want to check in, although five times may be adequate.  For example, if
  268. you want to check in a file which is 10 megabytes, you should have 100
  269. megabytes of memory on the machine doing the checkin (the server
  270. machine for client/server, or the machine running CVS for
  271. non-client/server).  This can be swap space rather than physical
  272. memory.  Because the memory is only required briefly, there is no
  273. particular need to allow memory for more than one such checkin at a
  274. time.
  275.  
  276.    Resource consumption for the client is even more modest--any machine
  277. with enough capacity to run the operating system in question should
  278. have little trouble.
  279.  
  280.    For information on disk space requirements, see *Note Creating a
  281. repository::.
  282.  
  283. 
  284. File: cvs.info,  Node: Connecting via rsh,  Next: Password authenticated,  Prev: Server requirements,  Up: Remote repositories
  285.  
  286. Connecting with rsh
  287. -------------------
  288.  
  289.    CVS uses the `rsh' protocol to perform these operations, so the
  290. remote user host needs to have a `.rhosts' file which grants access to
  291. the local user.
  292.  
  293.    For example, suppose you are the user `mozart' on the local machine
  294. `toe.example.com', and the server machine is `faun.example.org'.  On
  295. faun, put the following line into the file `.rhosts' in `bach''s home
  296. directory:
  297.  
  298.      toe.example.com  mozart
  299.  
  300.    Then test that `rsh' is working with
  301.  
  302.      rsh -l bach faun.example.org 'echo $PATH'
  303.  
  304.    Next you have to make sure that `rsh' will be able to find the
  305. server.  Make sure that the path which `rsh' printed in the above
  306. example includes the directory containing a program named `cvs' which
  307. is the server.  You need to set the path in `.bashrc', `.cshrc', etc.,
  308. not `.login' or `.profile'.  Alternately, you can set the environment
  309. variable `CVS_SERVER' on the client machine to the filename of the
  310. server you want to use, for example `/usr/local/bin/cvs-1.6'.
  311.  
  312.    There is no need to edit `inetd.conf' or start a CVS server daemon.
  313.  
  314.    There are two access methods that you use in `CVSROOT' for rsh.
  315. `:server:' specifies an internal rsh client, which is supported only by
  316. some CVS ports.  `:ext:' specifies an external rsh program.  By default
  317. this is `rsh' but you may set the `CVS_RSH' environment variable to
  318. invoke another program which can access the remote server (for example,
  319. `remsh' on HP-UX 9 because `rsh' is something different).  It must be a
  320. program which can transmit data to and from the server without modifying
  321. it; for example the Windows NT `rsh' is not suitable since it by
  322. default translates between CRLF and LF.  The OS/2 CVS port has a hack
  323. to pass `-b' to `rsh' to get around this, but since this could
  324. potentially cause problems for programs other than the standard `rsh',
  325. it may change in the future.  If you set `CVS_RSH' to `SSH' or some
  326. other rsh replacement, the instructions in the rest of this section
  327. concerning `.rhosts' and so on are likely to be inapplicable; consult
  328. the documentation for your rsh replacement.
  329.  
  330.    Continuing our example, supposing you want to access the module
  331. `foo' in the repository `/usr/local/cvsroot/', on machine
  332. `faun.example.org', you are ready to go:
  333.  
  334.      cvs -d :ext:bach@faun.example.org:/usr/local/cvsroot checkout foo
  335.  
  336.    (The `bach@' can be omitted if the username is the same on both the
  337. local and remote hosts.)
  338.  
  339. 
  340. File: cvs.info,  Node: Password authenticated,  Next: GSSAPI authenticated,  Prev: Connecting via rsh,  Up: Remote repositories
  341.  
  342. Direct connection with password authentication
  343. ----------------------------------------------
  344.  
  345.    The CVS client can also connect to the server using a password
  346. protocol.  This is particularly useful if using `rsh' is not feasible
  347. (for example, the server is behind a firewall), and Kerberos also is
  348. not available.
  349.  
  350.    To use this method, it is necessary to make some adjustments on both
  351. the server and client sides.
  352.  
  353. * Menu:
  354.  
  355. * Password authentication server::     Setting up the server
  356. * Password authentication client::     Using the client
  357. * Password authentication security::   What this method does and does not do
  358.  
  359. 
  360. File: cvs.info,  Node: Password authentication server,  Next: Password authentication client,  Up: Password authenticated
  361.  
  362. Setting up the server for password authentication
  363. .................................................
  364.  
  365.    First of all, you probably want to tighten the permissions on the
  366. `$CVSROOT' and `$CVSROOT/CVSROOT' directories.  See *Note Password
  367. authentication security::, for more details.
  368.  
  369.    On the server side, the file `/etc/inetd.conf' needs to be edited so
  370. `inetd' knows to run the command `cvs pserver' when it receives a
  371. connection on the right port.  By default, the port number is 2401; it
  372. would be different if your client were compiled with `CVS_AUTH_PORT'
  373. defined to something else, though.
  374.  
  375.    If your `inetd' allows raw port numbers in `/etc/inetd.conf', then
  376. the following (all on a single line in `inetd.conf') should be
  377. sufficient:
  378.  
  379.      2401  stream  tcp  nowait  root  /usr/local/bin/cvs
  380.      cvs -f --allow-root=/usr/cvsroot pserver
  381.  
  382.    You could also use the `-T' option to specify a temporary directory.
  383.  
  384.    The `--allow-root' option specifies the allowable CVSROOT directory.
  385. Clients which attempt to use a different CVSROOT directory will not be
  386. allowed to connect.  If there is more than one CVSROOT directory which
  387. you want to allow, repeat the option.  (Unfortunately, many versions of
  388. `inetd' have very small limits on the number of arguments and/or the
  389. total length of the command.  The usual solution to this problem is to
  390. have `inetd' run a shell script which then invokes CVS with the
  391. necessary arguments.)
  392.  
  393.    If your `inetd' wants a symbolic service name instead of a raw port
  394. number, then put this in `/etc/services':
  395.  
  396.      cvspserver      2401/tcp
  397.  
  398.    and put `cvspserver' instead of `2401' in `inetd.conf'.
  399.  
  400.    Once the above is taken care of, restart your `inetd', or do
  401. whatever is necessary to force it to reread its initialization files.
  402.  
  403.    If you are having trouble setting this up, see *Note Connection::.
  404.  
  405.    Because the client stores and transmits passwords in cleartext
  406. (almost--see *Note Password authentication security::, for details), a
  407. separate CVS password file is generally used, so people don't compromise
  408. their regular passwords when they access the repository.  This file is
  409. `$CVSROOT/CVSROOT/passwd' (*note Intro administrative files::).  It
  410. uses a colon-separated format, similar to `/etc/passwd' on Unix systems,
  411. except that it has fewer fields: CVS username, optional password, and
  412. an optional system username for CVS to run as if authentication
  413. succeeds.  Here is an example `passwd' file with five entries:
  414.  
  415.      anonymous:
  416.      bach:ULtgRLXo7NRxs
  417.      spwang:1sOp854gDF3DY
  418.      melissa:tGX1fS8sun6rY:pubcvs
  419.      qproj:XR4EZcEs0szik:pubcvs
  420.  
  421.    (The passwords are encrypted according to the standard Unix
  422. `crypt()' function, so it is possible to paste in passwords directly
  423. from regular Unix `/etc/passwd' files.)
  424.  
  425.    The first line in the example will grant access to any CVS client
  426. attempting to authenticate as user `anonymous', no matter what password
  427. they use, including an empty password.  (This is typical for sites
  428. granting anonymous read-only access; for information on how to do the
  429. "read-only" part, see *Note Read-only access::.)
  430.  
  431.    The second and third lines will grant access to `bach' and `spwang'
  432. if they supply their respective plaintext passwords.
  433.  
  434.    The fourth line will grant access to `melissa', if she supplies the
  435. correct password, but her CVS operations will actually run on the
  436. server side under the system user `pubcvs'.  Thus, there need not be
  437. any system user named `melissa', but there _must_ be one named `pubcvs'.
  438.  
  439.    The fifth line shows that system user identities can be shared: any
  440. client who successfully authenticates as `qproj' will actually run as
  441. `pubcvs', just as `melissa' does.  That way you could create a single,
  442. shared system user for each project in your repository, and give each
  443. developer their own line in the `$CVSROOT/CVSROOT/passwd' file.  The CVS
  444. username on each line would be different, but the system username would
  445. be the same.  The reason to have different CVS usernames is that CVS
  446. will log their actions under those names: when `melissa' commits a
  447. change to a project, the checkin is recorded in the project's history
  448. under the name `melissa', not `pubcvs'.  And the reason to have them
  449. share a system username is so that you can arrange permissions in the
  450. relevant area of the repository such that only that account has
  451. write-permission there.
  452.  
  453.    If the system-user field is present, all password-authenticated CVS
  454. commands run as that user; if no system user is specified, CVS simply
  455. takes the CVS username as the system username and runs commands as that
  456. user.  In either case, if there is no such user on the system, then the
  457. CVS operation will fail (regardless of whether the client supplied a
  458. valid password).
  459.  
  460.    The password and system-user fields can both be omitted (and if the
  461. system-user field is omitted, then also omit the colon that would have
  462. separated it from the encrypted password).  For example, this would be a
  463. valid `$CVSROOT/CVSROOT/passwd' file:
  464.  
  465.      anonymous::pubcvs
  466.      fish:rKa5jzULzmhOo:kfogel
  467.      sussman:1sOp854gDF3DY
  468.  
  469.    When the password field is omitted or empty, then the client's
  470. authentication attempt will succeed with any password, including the
  471. empty string.  However, the colon after the CVS username is always
  472. necessary, even if the password is empty.
  473.  
  474.    CVS can also fall back to use system authentication.  When
  475. authenticating a password, the server first checks for the user in the
  476. `$CVSROOT/CVSROOT/passwd' file.  If it finds the user, it will use that
  477. entry for authentication as described above.  But if it does not find
  478. the user, or if the CVS `passwd' file does not exist, then the server
  479. can try to authenticate the username and password using the operating
  480. system's user-lookup routines (this "fallback" behavior can be disabled
  481. by setting `SystemAuth=no' in the CVS `config' file, *note config::).
  482. Be aware, however, that falling back to system authentication might be
  483. a security risk: CVS operations would then be authenticated with that
  484. user's regular login password, and the password flies across the
  485. network in plaintext.  See *Note Password authentication security:: for
  486. more on this.
  487.  
  488.    Right now, the only way to put a password in the CVS `passwd' file
  489. is to paste it there from somewhere else.  Someday, there may be a `cvs
  490. passwd' command.
  491.  
  492.    Unlike many of the files in `$CVSROOT/CVSROOT', it is normal to edit
  493. the `passwd' file in-place, rather than via CVS.  This is because of the
  494. possible security risks of having the `passwd' file checked out to
  495. people's working copies.  If you do want to include the `passwd' file
  496. in checkouts of `$CVSROOT/CVSROOT', see *Note checkoutlist::.
  497.  
  498. 
  499. File: cvs.info,  Node: Password authentication client,  Next: Password authentication security,  Prev: Password authentication server,  Up: Password authenticated
  500.  
  501. Using the client with password authentication
  502. .............................................
  503.  
  504.    To run a CVS command on a remote repository via the
  505. password-authenticating server, one specifies the `pserver' protocol,
  506. username, repository host, and path to the repository.  For example:
  507.  
  508.      cvs -d :pserver:bach@faun.example.org:/usr/local/cvsroot checkout someproj
  509.  
  510.    or
  511.  
  512.      CVSROOT=:pserver:bach@faun.example.org:/usr/local/cvsroot
  513.      cvs checkout someproj
  514.  
  515.    However, unless you're connecting to a public-access repository
  516. (i.e., one where that username doesn't require a password), you'll need
  517. to "log in" first.  Logging in verifies your password with the
  518. repository.  It's done with the `login' command, which will prompt you
  519. interactively for the password:
  520.  
  521.      cvs -d :pserver:bach@faun.example.org:/usr/local/cvsroot login
  522.      CVS password:
  523.  
  524.    After you enter the password, CVS verifies it with the server.  If
  525. the verification succeeds, then that combination of username, host,
  526. repository, and password is permanently recorded, so future
  527. transactions with that repository won't require you to run `cvs login'.
  528. (If verification fails, CVS will exit complaining that the password
  529. was incorrect, and nothing will be recorded.)
  530.  
  531.    The records are stored, by default, in the file `$HOME/.cvspass'.
  532. That file's format is human-readable, and to a degree human-editable,
  533. but note that the passwords are not stored in cleartext--they are
  534. trivially encoded to protect them from "innocent" compromise (i.e.,
  535. inadvertent viewing by a system administrator or other non-malicious
  536. person).
  537.  
  538.    You can change the default location of this file by setting the
  539. `CVS_PASSFILE' environment variable.  If you use this variable, make
  540. sure you set it _before_ `cvs login' is run.  If you were to set it
  541. after running `cvs login', then later CVS commands would be unable to
  542. look up the password for transmission to the server.
  543.  
  544.    Once you have logged in, all CVS commands using that remote
  545. repository and username will authenticate with the stored password.
  546. So, for example
  547.  
  548.      cvs -d :pserver:bach@faun.example.org:/usr/local/cvsroot checkout foo
  549.  
  550.    should just work (unless the password changes on the server side, in
  551. which case you'll have to re-run `cvs login').
  552.  
  553.    Note that if the `:pserver:' were not present in the repository
  554. specification, CVS would assume it should use `rsh' to connect with the
  555. server instead (*note Connecting via rsh::).
  556.  
  557.    Of course, once you have a working copy checked out and are running
  558. CVS commands from within it, there is no longer any need to specify the
  559. repository explicitly, because CVS can deduce the repository from the
  560. working copy's `CVS' subdirectory.
  561.  
  562.    The password for a given remote repository can be removed from the
  563. `CVS_PASSFILE' by using the `cvs logout' command.
  564.  
  565. 
  566. File: cvs.info,  Node: Password authentication security,  Prev: Password authentication client,  Up: Password authenticated
  567.  
  568. Security considerations with password authentication
  569. ....................................................
  570.  
  571.    The passwords are stored on the client side in a trivial encoding of
  572. the cleartext, and transmitted in the same encoding.  The encoding is
  573. done only to prevent inadvertent password compromises (i.e., a system
  574. administrator accidentally looking at the file), and will not prevent
  575. even a naive attacker from gaining the password.
  576.  
  577.    The separate CVS password file (*note Password authentication
  578. server::) allows people to use a different password for repository
  579. access than for login access.  On the other hand, once a user has
  580. non-read-only access to the repository, she can execute programs on the
  581. server system through a variety of means.  Thus, repository access
  582. implies fairly broad system access as well.  It might be possible to
  583. modify CVS to prevent that, but no one has done so as of this writing.
  584.  
  585.    Note that because the `$CVSROOT/CVSROOT' directory contains `passwd'
  586. and other files which are used to check security, you must control the
  587. permissions on this directory as tightly as the permissions on `/etc'.
  588. The same applies to the `$CVSROOT' directory itself and any directory
  589. above it in the tree.  Anyone who has write access to such a directory
  590. will have the ability to become any user on the system.  Note that
  591. these permissions are typically tighter than you would use if you are
  592. not using pserver.
  593.  
  594.    In summary, anyone who gets the password gets repository access
  595. (which may imply some measure of general system access as well).  The
  596. password is available to anyone who can sniff network packets or read a
  597. protected (i.e., user read-only) file.  If you want real security, get
  598. Kerberos.
  599.  
  600. 
  601. File: cvs.info,  Node: GSSAPI authenticated,  Next: Kerberos authenticated,  Prev: Password authenticated,  Up: Remote repositories
  602.  
  603. Direct connection with GSSAPI
  604. -----------------------------
  605.  
  606.    GSSAPI is a generic interface to network security systems such as
  607. Kerberos 5.  If you have a working GSSAPI library, you can have CVS
  608. connect via a direct TCP connection, authenticating with GSSAPI.
  609.  
  610.    To do this, CVS needs to be compiled with GSSAPI support; when
  611. configuring CVS it tries to detect whether GSSAPI libraries using
  612. kerberos version 5 are present.  You can also use the `--with-gssapi'
  613. flag to configure.
  614.  
  615.    The connection is authenticated using GSSAPI, but the message stream
  616. is _not_ authenticated by default.  You must use the `-a' global option
  617. to request stream authentication.
  618.  
  619.    The data transmitted is _not_ encrypted by default.  Encryption
  620. support must be compiled into both the client and the server; use the
  621. `--enable-encrypt' configure option to turn it on.  You must then use
  622. the `-x' global option to request encryption.
  623.  
  624.    GSSAPI connections are handled on the server side by the same server
  625. which handles the password authentication server; see *Note Password
  626. authentication server::.  If you are using a GSSAPI mechanism such as
  627. Kerberos which provides for strong authentication, you will probably
  628. want to disable the ability to authenticate via cleartext passwords.
  629. To do so, create an empty `CVSROOT/passwd' password file, and set
  630. `SystemAuth=no' in the config file (*note config::).
  631.  
  632.    The GSSAPI server uses a principal name of cvs/HOSTNAME, where
  633. HOSTNAME is the canonical name of the server host.  You will have to
  634. set this up as required by your GSSAPI mechanism.
  635.  
  636.    To connect using GSSAPI, use `:gserver:'.  For example,
  637.  
  638.      cvs -d :gserver:faun.example.org:/usr/local/cvsroot checkout foo
  639.  
  640. 
  641. File: cvs.info,  Node: Kerberos authenticated,  Next: Connecting via fork,  Prev: GSSAPI authenticated,  Up: Remote repositories
  642.  
  643. Direct connection with kerberos
  644. -------------------------------
  645.  
  646.    The easiest way to use kerberos is to use the kerberos `rsh', as
  647. described in *Note Connecting via rsh::.  The main disadvantage of
  648. using rsh is that all the data needs to pass through additional
  649. programs, so it may be slower.  So if you have kerberos installed you
  650. can connect via a direct TCP connection, authenticating with kerberos.
  651.  
  652.    This section concerns the kerberos network security system, version
  653. 4.  Kerberos version 5 is supported via the GSSAPI generic network
  654. security interface, as described in the previous section.
  655.  
  656.    To do this, CVS needs to be compiled with kerberos support; when
  657. configuring CVS it tries to detect whether kerberos is present or you
  658. can use the `--with-krb4' flag to configure.
  659.  
  660.    The data transmitted is _not_ encrypted by default.  Encryption
  661. support must be compiled into both the client and server; use the
  662. `--enable-encryption' configure option to turn it on.  You must then
  663. use the `-x' global option to request encryption.
  664.  
  665.    You need to edit `inetd.conf' on the server machine to run `cvs
  666. kserver'.  The client uses port 1999 by default; if you want to use
  667. another port specify it in the `CVS_CLIENT_PORT' environment variable
  668. on the client.
  669.  
  670.    When you want to use CVS, get a ticket in the usual way (generally
  671. `kinit'); it must be a ticket which allows you to log into the server
  672. machine.  Then you are ready to go:
  673.  
  674.      cvs -d :kserver:faun.example.org:/usr/local/cvsroot checkout foo
  675.  
  676.    Previous versions of CVS would fall back to a connection via rsh;
  677. this version will not do so.
  678.  
  679. 
  680. File: cvs.info,  Node: Connecting via fork,  Prev: Kerberos authenticated,  Up: Remote repositories
  681.  
  682. Connecting with fork
  683. --------------------
  684.  
  685.    This access method allows you to connect to a repository on your
  686. local disk via the remote protocol.  In other words it does pretty much
  687. the same thing as `:local:', but various quirks, bugs and the like are
  688. those of the remote CVS rather than the local CVS.
  689.  
  690.    For day-to-day operations you might prefer either `:local:' or
  691. `:fork:', depending on your preferences.  Of course `:fork:' comes in
  692. particularly handy in testing or debugging `cvs' and the remote
  693. protocol.  Specifically, we avoid all of the network-related
  694. setup/configuration, timeouts, and authentication inherent in the other
  695. remote access methods but still create a connection which uses the
  696. remote protocol.
  697.  
  698.    To connect using the `fork' method, use `:fork:' and the pathname to
  699. your local repository.  For example:
  700.  
  701.      cvs -d :fork:/usr/local/cvsroot checkout foo
  702.  
  703.    As with `:ext:', the server is called `cvs' by default, or the value
  704. of the `CVS_SERVER' environment variable.
  705.  
  706. 
  707. File: cvs.info,  Node: Read-only access,  Next: Server temporary directory,  Prev: Remote repositories,  Up: Repository
  708.  
  709. Read-only repository access
  710. ===========================
  711.  
  712.    It is possible to grant read-only repository access to people using
  713. the password-authenticated server (*note Password authenticated::).
  714. (The other access methods do not have explicit support for read-only
  715. users because those methods all assume login access to the repository
  716. machine anyway, and therefore the user can do whatever local file
  717. permissions allow her to do.)
  718.  
  719.    A user who has read-only access can do only those CVS operations
  720. which do not modify the repository, except for certain "administrative"
  721. files (such as lock files and the history file).  It may be desirable
  722. to use this feature in conjunction with user-aliasing (*note Password
  723. authentication server::).
  724.  
  725.    Unlike with previous versions of CVS, read-only users should be able
  726. merely to read the repository, and not to execute programs on the
  727. server or otherwise gain unexpected levels of access.  Or to be more
  728. accurate, the _known_ holes have been plugged.  Because this feature is
  729. new and has not received a comprehensive security audit, you should use
  730. whatever level of caution seems warranted given your attitude concerning
  731. security.
  732.  
  733.    There are two ways to specify read-only access for a user: by
  734. inclusion, and by exclusion.
  735.  
  736.    "Inclusion" means listing that user specifically in the
  737. `$CVSROOT/CVSROOT/readers' file, which is simply a newline-separated
  738. list of users.  Here is a sample `readers' file:
  739.  
  740.      melissa
  741.      splotnik
  742.      jrandom
  743.  
  744.    (Don't forget the newline after the last user.)
  745.  
  746.    "Exclusion" means explicitly listing everyone who has _write_
  747. access--if the file
  748.  
  749.      $CVSROOT/CVSROOT/writers
  750.  
  751. exists, then only those users listed in it have write access, and
  752. everyone else has read-only access (of course, even the read-only users
  753. still need to be listed in the CVS `passwd' file).  The `writers' file
  754. has the same format as the `readers' file.
  755.  
  756.    Note: if your CVS `passwd' file maps cvs users onto system users
  757. (*note Password authentication server::), make sure you deny or grant
  758. read-only access using the _cvs_ usernames, not the system usernames.
  759. That is, the `readers' and `writers' files contain cvs usernames, which
  760. may or may not be the same as system usernames.
  761.  
  762.    Here is a complete description of the server's behavior in deciding
  763. whether to grant read-only or read-write access:
  764.  
  765.    If `readers' exists, and this user is listed in it, then she gets
  766. read-only access.  Or if `writers' exists, and this user is NOT listed
  767. in it, then she also gets read-only access (this is true even if
  768. `readers' exists but she is not listed there).  Otherwise, she gets
  769. full read-write access.
  770.  
  771.    Of course there is a conflict if the user is listed in both files.
  772. This is resolved in the more conservative way, it being better to
  773. protect the repository too much than too little: such a user gets
  774. read-only access.
  775.  
  776. 
  777. File: cvs.info,  Node: Server temporary directory,  Prev: Read-only access,  Up: Repository
  778.  
  779. Temporary directories for the server
  780. ====================================
  781.  
  782.    While running, the CVS server creates temporary directories.  They
  783. are named
  784.  
  785.      cvs-servPID
  786.  
  787. where PID is the process identification number of the server.  They are
  788. located in the directory specified by the `TMPDIR' environment variable
  789. (*note Environment variables::), the `-T' global option (*note Global
  790. options::), or failing that `/tmp'.
  791.  
  792.    In most cases the server will remove the temporary directory when it
  793. is done, whether it finishes normally or abnormally.  However, there
  794. are a few cases in which the server does not or cannot remove the
  795. temporary directory, for example:
  796.  
  797.    * If the server aborts due to an internal server error, it may
  798.      preserve the directory to aid in debugging
  799.  
  800.    * If the server is killed in a way that it has no way of cleaning up
  801.      (most notably, `kill -KILL' on unix).
  802.  
  803.    * If the system shuts down without an orderly shutdown, which tells
  804.      the server to clean up.
  805.  
  806.    In cases such as this, you will need to manually remove the
  807. `cvs-servPID' directories.  As long as there is no server running with
  808. process identification number PID, it is safe to do so.
  809.  
  810. 
  811. File: cvs.info,  Node: Starting a new project,  Next: Revisions,  Prev: Repository,  Up: Top
  812.  
  813. Starting a project with CVS
  814. ***************************
  815.  
  816.    Because renaming files and moving them between directories is
  817. somewhat inconvenient, the first thing you do when you start a new
  818. project should be to think through your file organization.  It is not
  819. impossible to rename or move files, but it does increase the potential
  820. for confusion and CVS does have some quirks particularly in the area of
  821. renaming directories.  *Note Moving files::.
  822.  
  823.    What to do next depends on the situation at hand.
  824.  
  825. * Menu:
  826.  
  827. * Setting up the files::        Getting the files into the repository
  828. * Defining the module::         How to make a module of the files
  829.  
  830. 
  831. File: cvs.info,  Node: Setting up the files,  Next: Defining the module,  Up: Starting a new project
  832.  
  833. Setting up the files
  834. ====================
  835.  
  836.    The first step is to create the files inside the repository.  This
  837. can be done in a couple of different ways.
  838.  
  839. * Menu:
  840.  
  841. * From files::                  This method is useful with old projects
  842.                                 where files already exists.
  843. * From other version control systems::  Old projects where you want to
  844.                                         preserve history from another system.
  845. * From scratch::                Creating a directory tree from scratch.
  846.  
  847. 
  848. File: cvs.info,  Node: From files,  Next: From other version control systems,  Up: Setting up the files
  849.  
  850. Creating a directory tree from a number of files
  851. ------------------------------------------------
  852.  
  853.    When you begin using CVS, you will probably already have several
  854. projects that can be put under CVS control.  In these cases the easiest
  855. way is to use the `import' command.  An example is probably the easiest
  856. way to explain how to use it.  If the files you want to install in CVS
  857. reside in `WDIR', and you want them to appear in the repository as
  858. `$CVSROOT/yoyodyne/RDIR', you can do this:
  859.  
  860.      $ cd WDIR
  861.      $ cvs import -m "Imported sources" yoyodyne/RDIR yoyo start
  862.  
  863.    Unless you supply a log message with the `-m' flag, CVS starts an
  864. editor and prompts for a message.  The string `yoyo' is a "vendor tag",
  865. and `start' is a "release tag".  They may fill no purpose in this
  866. context, but since CVS requires them they must be present.  *Note
  867. Tracking sources::, for more information about them.
  868.  
  869.    You can now verify that it worked, and remove your original source
  870. directory.
  871.  
  872.      $ cd ..
  873.      $ cvs checkout yoyodyne/RDIR       # Explanation below
  874.      $ diff -r WDIR yoyodyne/RDIR
  875.      $ rm -r WDIR
  876.  
  877. Erasing the original sources is a good idea, to make sure that you do
  878. not accidentally edit them in WDIR, bypassing CVS.  Of course, it would
  879. be wise to make sure that you have a backup of the sources before you
  880. remove them.
  881.  
  882.    The `checkout' command can either take a module name as argument (as
  883. it has done in all previous examples) or a path name relative to
  884. `$CVSROOT', as it did in the example above.
  885.  
  886.    It is a good idea to check that the permissions CVS sets on the
  887. directories inside `$CVSROOT' are reasonable, and that they belong to
  888. the proper groups.  *Note File permissions::.
  889.  
  890.    If some of the files you want to import are binary, you may want to
  891. use the wrappers features to specify which files are binary and which
  892. are not.  *Note Wrappers::.
  893.  
  894. 
  895. File: cvs.info,  Node: From other version control systems,  Next: From scratch,  Prev: From files,  Up: Setting up the files
  896.  
  897. Creating Files From Other Version Control Systems
  898. -------------------------------------------------
  899.  
  900.    If you have a project which you are maintaining with another version
  901. control system, such as RCS, you may wish to put the files from that
  902. project into CVS, and preserve the revision history of the files.
  903.  
  904. From RCS
  905.      If you have been using RCS, find the RCS files--usually a file
  906.      named `foo.c' will have its RCS file in `RCS/foo.c,v' (but it
  907.      could be other places; consult the RCS documentation for details).
  908.      Then create the appropriate directories in CVS if they do not
  909.      already exist.  Then copy the files into the appropriate
  910.      directories in the CVS repository (the name in the repository must
  911.      be the name of the source file with `,v' added; the files go
  912.      directly in the appropriate directory of the repository, not in an
  913.      `RCS' subdirectory).  This is one of the few times when it is a
  914.      good idea to access the CVS repository directly, rather than using
  915.      CVS commands.  Then you are ready to check out a new working
  916.      directory.
  917.  
  918.      The RCS file should not be locked when you move it into CVS; if it
  919.      is, CVS will have trouble letting you operate on it.
  920.  
  921. From another version control system
  922.      Many version control systems have the ability to export RCS files
  923.      in the standard format.  If yours does, export the RCS files and
  924.      then follow the above instructions.
  925.  
  926.      Failing that, probably your best bet is to write a script that
  927.      will check out the files one revision at a time using the command
  928.      line interface to the other system, and then check the revisions
  929.      into CVS.  The `sccs2rcs' script mentioned below may be a useful
  930.      example to follow.
  931.  
  932. From SCCS
  933.      There is a script in the `contrib' directory of the CVS source
  934.      distribution called `sccs2rcs' which converts SCCS files to RCS
  935.      files.  Note: you must run it on a machine which has both SCCS and
  936.      RCS installed, and like everything else in contrib it is
  937.      unsupported (your mileage may vary).
  938.  
  939. From PVCS
  940.      There is a script in the `contrib' directory of the CVS source
  941.      distribution called `pvcs_to_rcs' which converts PVCS archives to
  942.      RCS files.  You must run it on a machine which has both PVCS and
  943.      RCS installed, and like everything else in contrib it is
  944.      unsupported (your mileage may vary).  See the comments in the
  945.      script for details.
  946.  
  947. 
  948. File: cvs.info,  Node: From scratch,  Prev: From other version control systems,  Up: Setting up the files
  949.  
  950. Creating a directory tree from scratch
  951. --------------------------------------
  952.  
  953.    For a new project, the easiest thing to do is probably to create an
  954. empty directory structure, like this:
  955.  
  956.      $ mkdir tc
  957.      $ mkdir tc/man
  958.      $ mkdir tc/testing
  959.  
  960.    After that, you use the `import' command to create the corresponding
  961. (empty) directory structure inside the repository:
  962.  
  963.      $ cd tc
  964.      $ cvs import -m "Created directory structure" yoyodyne/DIR yoyo start
  965.  
  966.    Then, use `add' to add files (and new directories) as they appear.
  967.  
  968.    Check that the permissions CVS sets on the directories inside
  969. `$CVSROOT' are reasonable.
  970.  
  971. 
  972. File: cvs.info,  Node: Defining the module,  Prev: Setting up the files,  Up: Starting a new project
  973.  
  974. Defining the module
  975. ===================
  976.  
  977.    The next step is to define the module in the `modules' file.  This
  978. is not strictly necessary, but modules can be convenient in grouping
  979. together related files and directories.
  980.  
  981.    In simple cases these steps are sufficient to define a module.
  982.  
  983.   1. Get a working copy of the modules file.
  984.  
  985.           $ cvs checkout CVSROOT/modules
  986.           $ cd CVSROOT
  987.  
  988.   2. Edit the file and insert a line that defines the module.  *Note
  989.      Intro administrative files::, for an introduction.  *Note
  990.      modules::, for a full description of the modules file.  You can
  991.      use the following line to define the module `tc':
  992.  
  993.           tc   yoyodyne/tc
  994.  
  995.   3. Commit your changes to the modules file.
  996.  
  997.           $ cvs commit -m "Added the tc module." modules
  998.  
  999.   4. Release the modules module.
  1000.  
  1001.           $ cd ..
  1002.           $ cvs release -d CVSROOT
  1003.  
  1004. 
  1005. File: cvs.info,  Node: Revisions,  Next: Branching and merging,  Prev: Starting a new project,  Up: Top
  1006.  
  1007. Revisions
  1008. *********
  1009.  
  1010.    For many uses of CVS, one doesn't need to worry too much about
  1011. revision numbers; CVS assigns numbers such as `1.1', `1.2', and so on,
  1012. and that is all one needs to know.  However, some people prefer to have
  1013. more knowledge and control concerning how CVS assigns revision numbers.
  1014.  
  1015.    If one wants to keep track of a set of revisions involving more than
  1016. one file, such as which revisions went into a particular release, one
  1017. uses a "tag", which is a symbolic revision which can be assigned to a
  1018. numeric revision in each file.
  1019.  
  1020. * Menu:
  1021.  
  1022. * Revision numbers::            The meaning of a revision number
  1023. * Versions revisions releases::  Terminology used in this manual
  1024. * Assigning revisions::         Assigning revisions
  1025. * Tags::                        Tags--Symbolic revisions
  1026. * Tagging the working directory::  The cvs tag command
  1027. * Tagging by date/tag::         The cvs rtag command
  1028. * Modifying tags::              Adding, renaming, and deleting tags
  1029. * Tagging add/remove::          Tags with adding and removing files
  1030. * Sticky tags::                 Certain tags are persistent
  1031.  
  1032. 
  1033. File: cvs.info,  Node: Revision numbers,  Next: Versions revisions releases,  Up: Revisions
  1034.  
  1035. Revision numbers
  1036. ================
  1037.  
  1038.    Each version of a file has a unique "revision number".  Revision
  1039. numbers look like `1.1', `1.2', `1.3.2.2' or even `1.3.2.2.4.5'.  A
  1040. revision number always has an even number of period-separated decimal
  1041. integers.  By default revision 1.1 is the first revision of a file.
  1042. Each successive revision is given a new number by increasing the
  1043. rightmost number by one.  The following figure displays a few
  1044. revisions, with newer revisions to the right.
  1045.  
  1046.             +-----+    +-----+    +-----+    +-----+    +-----+
  1047.             ! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 !
  1048.             +-----+    +-----+    +-----+    +-----+    +-----+
  1049.  
  1050.    It is also possible to end up with numbers containing more than one
  1051. period, for example `1.3.2.2'.  Such revisions represent revisions on
  1052. branches (*note Branching and merging::); such revision numbers are
  1053. explained in detail in *Note Branches and revisions::.
  1054.  
  1055. 
  1056. File: cvs.info,  Node: Versions revisions releases,  Next: Assigning revisions,  Prev: Revision numbers,  Up: Revisions
  1057.  
  1058. Versions, revisions and releases
  1059. ================================
  1060.  
  1061.    A file can have several versions, as described above.  Likewise, a
  1062. software product can have several versions.  A software product is
  1063. often given a version number such as `4.1.1'.
  1064.  
  1065.    Versions in the first sense are called "revisions" in this document,
  1066. and versions in the second sense are called "releases".  To avoid
  1067. confusion, the word "version" is almost never used in this document.
  1068.  
  1069. 
  1070. File: cvs.info,  Node: Assigning revisions,  Next: Tags,  Prev: Versions revisions releases,  Up: Revisions
  1071.  
  1072. Assigning revisions
  1073. ===================
  1074.  
  1075.    By default, CVS will assign numeric revisions by leaving the first
  1076. number the same and incrementing the second number.  For example,
  1077. `1.1', `1.2', `1.3', etc.
  1078.  
  1079.    When adding a new file, the second number will always be one and the
  1080. first number will equal the highest first number of any file in that
  1081. directory.  For example, the current directory contains files whose
  1082. highest numbered revisions are `1.7', `3.1', and `4.12', then an added
  1083. file will be given the numeric revision `4.1'.
  1084.  
  1085.    Normally there is no reason to care about the revision numbers--it
  1086. is easier to treat them as internal numbers that CVS maintains, and tags
  1087. provide a better way to distinguish between things like release 1
  1088. versus release 2 of your product (*note Tags::).  However, if you want
  1089. to set the numeric revisions, the `-r' option to `cvs commit' can do
  1090. that.  The `-r' option implies the `-f' option, in the sense that it
  1091. causes the files to be committed even if they are not modified.
  1092.  
  1093.    For example, to bring all your files up to revision 3.0 (including
  1094. those that haven't changed), you might invoke:
  1095.  
  1096.      $ cvs commit -r 3.0
  1097.  
  1098.    Note that the number you specify with `-r' must be larger than any
  1099. existing revision number.  That is, if revision 3.0 exists, you cannot
  1100. `cvs commit -r 1.3'.  If you want to maintain several releases in
  1101. parallel, you need to use a branch (*note Branching and merging::).
  1102.  
  1103.