summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/server.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2007-06-27 20:42:20 +0000
committerJoris Vink <joris@cvs.openbsd.org>2007-06-27 20:42:20 +0000
commitfb38d9124799bad843d692eb8a6ca910e97265a2 (patch)
treee6be8d0e75108e9836f7c04a12afd7d3a71f4c22 /usr.bin/cvs/server.c
parent1a08b82585d709555dde68430d96d1c2b0eccc4c (diff)
have the server be more strict about the requests the client
sends that need a 'Directory' request first, so we do not end up with very weird and possibly insecure behaviour. more soon! ok niallo@ ray@ xsa@
Diffstat (limited to 'usr.bin/cvs/server.c')
-rw-r--r--usr.bin/cvs/server.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c
index b0af3d74332..2499afeafe3 100644
--- a/usr.bin/cvs/server.c
+++ b/usr.bin/cvs/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.62 2007/06/26 02:24:10 niallo Exp $ */
+/* $OpenBSD: server.c,v 1.63 2007/06/27 20:42:19 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -115,6 +115,10 @@ cvs_server(int argc, char **argv)
if (req->hdlr == NULL)
fatal("opencvs server does not support '%s'", cmd);
+ if ((req->flags & REQ_NEEDDIR) && (server_currentdir == NULL))
+ fatal("`%s' needs a directory to be sent with "
+ "the `Directory` request first", cmd);
+
(*req->hdlr)(data);
xfree(cmd);
}