<div id="Read_002donly-access"></div>
<div class="header">
<p>
Next: [[cvs: Temporary directories for the server#Temporary directories for the server|Server temporary directory]], Previous: [[cvs: Remote repositories#Remote repositories|Remote repositories]], Up: [[cvs: The Repository#The Repository|Repository]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>

----

<div id="Read_002donly-repository-access"></div>
=== Read-only repository access ===
<div id="index-Read_002donly-repository-access"></div>
<div id="index-readers-_0028admin-file_0029"></div>
<div id="index-writers-_0028admin-file_0029"></div>

It is possible to grant read-only repository
access to people using the password-authenticated
server (see [[cvs: Direct connection with password authentication#Direct connection with password authentication|Password authenticated]]).  (The
other access methods do not have explicit support for
read-only users because those methods all assume login
access to the repository machine anyway, and therefore
the user can do whatever local file permissions allow
her to do.)

A user who has read-only access can do only
those <small>CVS</small> operations which do not modify the
repository, except for certain &ldquo;administrative&rdquo; files
(such as lock files and the history file).  It may be
desirable to use this feature in conjunction with
user-aliasing (see [[cvs: Setting up the server for password authentication#Setting up the server for password authentication|Password authentication server]]).

Unlike with previous versions of <small>CVS</small>, read-only
users should be able merely to read the repository, and
not to execute programs on the server or otherwise gain
unexpected levels of access.  Or to be more accurate,
the ''known'' holes have been plugged.  Because this
feature is new and has not received a comprehensive
security audit, you should use whatever level of
caution seems warranted given your attitude concerning
security.

There are two ways to specify read-only access
for a user: by inclusion, and by exclusion.

&quot;Inclusion&quot; means listing that user
specifically in the &lsquo;<tt>$CVSROOT/CVSROOT/readers</tt>&rsquo;
file, which is simply a newline-separated list of
users.  Here is a sample &lsquo;<tt>readers</tt>&rsquo; file:

<div class="example" style="margin-left: 3.2em">
 melissa
 splotnik
 jrandom
</div>

(Don&rsquo;t forget the newline after the last user.)

&quot;Exclusion&quot; means explicitly listing everyone
who has ''write'' access&mdash;if the file

<div class="example" style="margin-left: 3.2em">
 $CVSROOT/CVSROOT/writers
</div>

exists, then only
those users listed in it have write access, and
everyone else has read-only access (of course, even the
read-only users still need to be listed in the
<small>CVS</small> &lsquo;<tt>passwd</tt>&rsquo; file).  The
&lsquo;<tt>writers</tt>&rsquo; file has the same format as the
&lsquo;<tt>readers</tt>&rsquo; file.

Note: if your <small>CVS</small> &lsquo;<tt>passwd</tt>&rsquo;
file maps cvs users onto system users (see [[cvs: Setting up the server for password authentication#Setting up the server for password authentication|Password authentication server]]), make sure you deny or grant
read-only access using the ''cvs'' usernames, not
the system usernames.  That is, the &lsquo;<tt>readers</tt>&rsquo; and
&lsquo;<tt>writers</tt>&rsquo; files contain cvs usernames, which may
or may not be the same as system usernames.

Here is a complete description of the server&rsquo;s
behavior in deciding whether to grant read-only or
read-write access:

If &lsquo;<tt>readers</tt>&rsquo; exists, and this user is
listed in it, then she gets read-only access.  Or if
&lsquo;<tt>writers</tt>&rsquo; exists, and this user is NOT listed in
it, then she also gets read-only access (this is true
even if &lsquo;<tt>readers</tt>&rsquo; exists but she is not listed
there).  Otherwise, she gets full read-write access.

Of course there is a conflict if the user is
listed in both files.  This is resolved in the more
conservative way, it being better to protect the
repository too much than too little: such a user gets
read-only access.


----

<div class="header">
<p>
Next: [[cvs: Temporary directories for the server#Temporary directories for the server|Server temporary directory]], Previous: [[cvs: Remote repositories#Remote repositories|Remote repositories]], Up: [[cvs: The Repository#The Repository|Repository]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
