summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-27 15:40:45 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-27 15:40:45 +0000
commit4fe06a725d91d6469ead7e0605f54e118d3c8c36 (patch)
tree80c59b1354b9157fdd0524ab2646b7357d8b48ab
parent4ee4e59f373b43d3e89d67bdf4e4810f034177d9 (diff)
cleanup and reset the valid requests array when allocating a new root
structure. Also enable the use of at least Valid-responses and valid-requests
-rw-r--r--usr.bin/cvs/cvs.h12
-rw-r--r--usr.bin/cvs/root.c8
2 files changed, 13 insertions, 7 deletions
diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h
index 79cf5c0f435..f13a31933aa 100644
--- a/usr.bin/cvs/cvs.h
+++ b/usr.bin/cvs/cvs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cvs.h,v 1.28 2004/08/13 12:47:54 jfb Exp $ */
+/* $OpenBSD: cvs.h,v 1.29 2004/08/27 15:40:44 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -144,13 +144,13 @@ struct cvsroot {
FILE *cr_srvin;
FILE *cr_srvout;
FILE *cr_srverr;
- char *cr_version; /* version of remote server */
- u_char cr_vrmask[10]; /* mask of valid requests supported by server */
+ char *cr_version; /* version of remote server */
+ u_char cr_vrmask[16]; /* mask of valid requests supported by server */
};
-#define CVS_SETVR(rt, rq) (rt)->cr_vrmask[(rq) / 8] |= (1 << ((rq) % 8))
-#define CVS_GETVR(rt, rq) (rt)->cr_vrmask[(rq) / 8] & (1 << ((rq) % 8))
-#define CVS_CLRVR(rt, rq) (rt)->cr_vrmask[(rq) / 8] &= ~(1 << ((rq) % 8))
+#define CVS_SETVR(rt, rq) ((rt)->cr_vrmask[(rq) / 8] |= (1 << ((rq) % 8)))
+#define CVS_GETVR(rt, rq) ((rt)->cr_vrmask[(rq) / 8] & (1 << ((rq) % 8)))
+#define CVS_CLRVR(rt, rq) ((rt)->cr_vrmask[(rq) / 8] &= ~(1 << ((rq) % 8)))
#define CVS_RSTVR(rt) memset((rt)->cr_vrmask, 0, sizeof((rt)->cr_vrmask))
diff --git a/usr.bin/cvs/root.c b/usr.bin/cvs/root.c
index efadc8920b6..9b08c30d5c5 100644
--- a/usr.bin/cvs/root.c
+++ b/usr.bin/cvs/root.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: root.c,v 1.9 2004/08/02 22:45:57 jfb Exp $ */
+/* $OpenBSD: root.c,v 1.10 2004/08/27 15:40:44 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -36,6 +36,7 @@
#include "cvs.h"
#include "log.h"
+#include "proto.h"
extern char *cvs_rootstr;
@@ -104,6 +105,11 @@ cvsroot_parse(const char *str)
memset(root, 0, sizeof(*root));
root->cr_ref = 2;
root->cr_method = CVS_METHOD_NONE;
+ CVS_RSTVR(root);
+
+ /* enable the most basic commands at least */
+ CVS_SETVR(root, CVS_REQ_VALIDREQ);
+ CVS_SETVR(root, CVS_REQ_VALIDRESP);
root->cr_str = strdup(str);
if (root->cr_str == NULL) {