diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2007-09-02 12:16:25 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2007-09-02 12:16:25 +0000 |
commit | be524287dc216d876f995eddcaf32762c702c6e9 (patch) | |
tree | c7ebbe027d0b66ee534789f645f79f32653bd357 /usr.bin/cvs | |
parent | a8e522746174266fb33af60b6b0d1e1d776954e7 (diff) |
OpenCVS server init-support with OpenCVS and GNU cvs clients.
OK joris@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/client.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/server.c | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c index 8e44dd10ee6..d5bd731fd62 100644 --- a/usr.bin/cvs/client.c +++ b/usr.bin/cvs/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.74 2007/09/02 11:11:12 tobias Exp $ */ +/* $OpenBSD: client.c,v 1.75 2007/09/02 12:16:24 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -106,7 +106,7 @@ struct cvs_req cvs_requests[] = { { "watch-remove", 0, NULL, 0 }, { "watchers", 0, NULL, 0 }, { "editors", 0, NULL, 0 }, - { "init", 0, cvs_server_init, REQ_NEEDDIR }, + { "init", 0, cvs_server_init, 0 }, { "annotate", 0, cvs_server_annotate, REQ_NEEDDIR }, { "rannotate", 0, NULL, 0 }, diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c index 3eac04eee97..712db2e1689 100644 --- a/usr.bin/cvs/server.c +++ b/usr.bin/cvs/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.68 2007/09/02 12:13:00 tobias Exp $ */ +/* $OpenBSD: server.c,v 1.69 2007/09/02 12:16:24 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -572,8 +572,14 @@ cvs_server_diff(char *data) void cvs_server_init(char *data) { - if (chdir(server_currentdir) == -1) - fatal("cvs_server_init: %s", strerror(errno)); + if (data == NULL) + fatal("Missing argument for init"); + + if (current_cvsroot != NULL) + fatal("Root in combination with init is not supported"); + + if ((current_cvsroot = cvsroot_get(data)) == NULL) + fatal("Invalid argument for init"); cvs_cmdop = CVS_OP_INIT; cvs_init(server_argc, server_argv); |