diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-12-19 10:41:08 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-12-19 10:41:08 +0000 |
commit | a692c34aea53351cfc93b71342fb96ddcc45f59f (patch) | |
tree | d9b122de13176dfe2e994ad8cd2ca05a4e9d7dcd | |
parent | d8d3fa7f696c03ecd58960ea9029ae9733fb9ced (diff) |
CVSREADONLYFS environment variable short-circuits read-only lock requirements
-rw-r--r-- | gnu/usr.bin/cvs/src/cvs.h | 3 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/src/lock.c | 2 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/src/main.c | 3 |
3 files changed, 7 insertions, 1 deletions
diff --git a/gnu/usr.bin/cvs/src/cvs.h b/gnu/usr.bin/cvs/src/cvs.h index d3133cd5abc..50bef89e568 100644 --- a/gnu/usr.bin/cvs/src/cvs.h +++ b/gnu/usr.bin/cvs/src/cvs.h @@ -219,6 +219,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 config.h */ @@ -362,6 +364,7 @@ extern int cvswrite; 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 */ extern char hostname[]; diff --git a/gnu/usr.bin/cvs/src/lock.c b/gnu/usr.bin/cvs/src/lock.c index 62bb88d4648..59216f300c9 100644 --- a/gnu/usr.bin/cvs/src/lock.c +++ b/gnu/usr.bin/cvs/src/lock.c @@ -123,7 +123,7 @@ Reader_Lock (xrepository) FILE *fp; char tmp[PATH_MAX]; - if (noexec) + if (noexec || readonlyfs) return (0); /* we only do one directory at a time for read locks! */ diff --git a/gnu/usr.bin/cvs/src/main.c b/gnu/usr.bin/cvs/src/main.c index cdf83511618..c15ac0a5fc1 100644 --- a/gnu/usr.bin/cvs/src/main.c +++ b/gnu/usr.bin/cvs/src/main.c @@ -68,6 +68,7 @@ int really_quiet = FALSE; int quiet = FALSE; int trace = FALSE; int noexec = FALSE; +int readonlyfs = FALSE; int logoff = FALSE; char *CurDir; @@ -270,6 +271,8 @@ main (argc, argv) } if (getenv (CVSREAD_ENV) != NULL) cvswrite = FALSE; + if (getenv (CVSREADONLYFS_ENV)) + readonlyfs = TRUE; /* This has the effect of setting getopt's ordering to REQUIRE_ORDER, which is what we need to distinguish between global options and |