summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-05-12 03:31:57 +0000
committerderaadt <deraadt@openbsd.org>1996-05-12 03:31:57 +0000
commite6f69528ddca54276be3ef086646115e97231f9c (patch)
tree8081432720cc86ab3e91da6d35a86e4e3309730c
parentfix usage string. (diff)
downloadwireguard-openbsd-e6f69528ddca54276be3ef086646115e97231f9c.tar.xz
wireguard-openbsd-e6f69528ddca54276be3ef086646115e97231f9c.zip
new extension: the $CVSROOT/CVSROOT/options file (if it exists) supports:
tag=-ZOpenBSD (passes -ZOpenBSD to co/ci) umask=002 (force a umask while cvs is running) dlimit=49152 (force a 48MB process data limit)
-rw-r--r--gnu/usr.bin/cvs/src/cvs.h2
-rw-r--r--gnu/usr.bin/cvs/src/main.c44
-rw-r--r--gnu/usr.bin/cvs/src/rcscmds.c6
3 files changed, 52 insertions, 0 deletions
diff --git a/gnu/usr.bin/cvs/src/cvs.h b/gnu/usr.bin/cvs/src/cvs.h
index 38fb5fb3c66..ac053441ec6 100644
--- a/gnu/usr.bin/cvs/src/cvs.h
+++ b/gnu/usr.bin/cvs/src/cvs.h
@@ -184,6 +184,7 @@ extern int errno;
#define CVSROOTADM_WRAPPER "cvswrappers"
#define CVSROOTADM_NOTIFY "notify"
#define CVSROOTADM_USERS "users"
+#define CVSROOTADM_OPTIONS "options"
#define CVSNULLREPOS "Emptydir" /* an empty directory */
@@ -415,6 +416,7 @@ 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 *RCS_citag; /* special -Z tag for RCS */
extern char hostname[];
diff --git a/gnu/usr.bin/cvs/src/main.c b/gnu/usr.bin/cvs/src/main.c
index dafe689f85d..cac95441644 100644
--- a/gnu/usr.bin/cvs/src/main.c
+++ b/gnu/usr.bin/cvs/src/main.c
@@ -678,6 +678,7 @@ error 0 %s: no such user\n", user);
"Sorry, you don't have read/write access to the history file");
error (1, save_errno, "%s", path);
}
+ parseopts();
}
}
@@ -837,3 +838,46 @@ usage (cpp)
(void) fprintf (stderr, *cpp);
exit (EXIT_FAILURE);
}
+
+parseopts()
+{
+ char path[PATH_MAX];
+ int save_errno;
+ char buf[1024];
+ char *p;
+ FILE *fp;
+
+ (void) sprintf (path, "%s/%s/%s", CVSroot, CVSROOTADM, CVSROOTADM_OPTIONS);
+ if ((fp = fopen(path, "r")) != NULL) {
+ while (fgets(buf, sizeof buf, fp) != NULL) {
+ if (buf[0] == '#')
+ continue;
+ p = strrchr(buf, '\n');
+ if (p)
+ *p = '\0';
+
+ if (!strncmp(buf, "tag=", 4)) {
+ RCS_citag = strdup(buf+4);
+ } else if (!strncmp(buf, "umask=", 6)) {
+ int mode;
+
+ mode = strtol(buf+6, NULL, 8);
+ umask((mode_t)mode);
+ }
+ else if (!strncmp(buf, "dlimit=", 7)) {
+#ifdef __OpenBSD__
+#include <sys/resource.h>
+ struct rlimit rl;
+
+ if (getrlimit(RLIMIT_DATA, &rl) != -1) {
+ rl.rlim_cur = atoi(buf+7);
+ rl.rlim_cur *= 1024;
+
+ (void) setrlimit(RLIMIT_DATA, &rl);
+ }
+#endif /* __OpenBSD__ */
+ }
+ }
+ fclose(fp);
+ }
+}
diff --git a/gnu/usr.bin/cvs/src/rcscmds.c b/gnu/usr.bin/cvs/src/rcscmds.c
index 66aea57447a..eabd1aec310 100644
--- a/gnu/usr.bin/cvs/src/rcscmds.c
+++ b/gnu/usr.bin/cvs/src/rcscmds.c
@@ -17,6 +17,8 @@
-1 for error (and errno is set to indicate the error), positive for
error (and an error message has been printed), or zero for success. */
+char *RCS_citag;
+
int
RCS_settag(path, tag, rev)
const char *path;
@@ -148,6 +150,8 @@ RCS_checkout (rcsfile, workfile, tag, options, sout, flags, noerr)
run_arg ("-l");
if (flags & RCS_FLAGS_FORCE)
run_arg ("-f");
+ if (RCS_citag)
+ run_arg (RCS_citag);
run_arg (rcsfile);
if (workfile != NULL && workfile[0] != '\0')
run_arg (workfile);
@@ -180,6 +184,8 @@ RCS_checkin (rcsfile, workfile, message, rev, flags, noerr)
run_arg ("-q");
if (flags & RCS_FLAGS_MODTIME)
run_arg ("-d");
+ if (RCS_citag)
+ run_arg (RCS_citag);
run_args ("-m%s", make_message_rcslegal (message));
if (workfile != NULL)
run_arg (workfile);