Pull in OpenBSD's support for checking out from a read-only repository,

such as within an anoncvs server, or from a CDROM repository.
Cyclic (the cvs maintainers) do not like this approach and have an
alternative read-only system, but that requires a read/write repository to
work (which rules out CDROM).

Obtained from: OpenBSD
This commit is contained in:
Peter Wemm 1997-05-17 14:01:25 +00:00
parent 16d2615d3e
commit 484aca02e2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25866
4 changed files with 11 additions and 3 deletions

View File

@ -256,6 +256,8 @@ extern int errno;
#define CVSREAD_ENV "CVSREAD" /* make files read-only */
#define CVSREAD_DFLT FALSE /* writable files by default */
#define CVSREADONLYFS_ENV "CVSREADONLYFS" /* repository is read-only */
#define RCSBIN_ENV "RCSBIN" /* RCS binary directory */
/* #define RCSBIN_DFLT Set by options.h */
@ -379,6 +381,7 @@ extern char *CVSroot_directory; /* the directory name */
extern int trace; /* Show all commands */
extern int noexec; /* Don't modify disk anywhere */
extern int readonlyfs; /* fail on all write locks; succeed all read locks */
extern int logoff; /* Don't write history entry */
#ifdef AUTH_SERVER_SUPPORT

View File

@ -243,7 +243,7 @@ Reader_Lock (xrepository)
FILE *fp;
char *tmp;
if (noexec)
if (noexec || readonlyfs)
return (0);
/* we only do one directory at a time for read locks! */

View File

@ -40,6 +40,7 @@ int really_quiet = FALSE;
int quiet = FALSE;
int trace = FALSE;
int noexec = FALSE;
int readonlyfs = FALSE;
int logoff = FALSE;
mode_t cvsumask = UMASK_DFLT;
@ -399,6 +400,10 @@ main (argc, argv)
}
if (getenv (CVSREAD_ENV) != NULL)
cvswrite = FALSE;
if (getenv (CVSREADONLYFS_ENV) != NULL) {
readonlyfs = TRUE;
logoff = TRUE;
}
/* I'm not sure whether this needs to be 1 instead of 0 anymore. Using
1 used to accomplish what passing "+" as the first character to
@ -729,7 +734,7 @@ main (argc, argv)
}
(void) strcat (path, "/");
(void) strcat (path, CVSROOTADM_HISTORY);
if (isfile (path) && !isaccessible (path, R_OK | W_OK))
if (readonlyfs == 0 && isfile (path) && !isaccessible (path, R_OK | W_OK))
{
save_errno = errno;
error (0, 0, "Sorry, you don't have read/write access to the history file");

View File

@ -543,7 +543,7 @@ serve_root (arg)
}
(void) strcat (path, "/");
(void) strcat (path, CVSROOTADM_HISTORY);
if (isfile (path) && !isaccessible (path, R_OK | W_OK))
if (readonlyfs == 0 && isfile (path) && !isaccessible (path, R_OK | W_OK))
{
save_errno = errno;
pending_error_text = malloc (80 + strlen (path));