summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2006-11-13 12:57:04 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2006-11-13 12:57:04 +0000
commit319bfc74f9ef4e39342cd183f879eb3569cf014d (patch)
tree43078ce3cb9f362a9109bb1927584c5c8cf1a6ed /usr.bin
parentb0f6777667b42ea8fd2b4b2a22960608c7b167ab (diff)
Add server-side bits for admin command.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/client.c4
-rw-r--r--usr.bin/cvs/cmd.c6
-rw-r--r--usr.bin/cvs/remote.h3
-rw-r--r--usr.bin/cvs/server.c14
4 files changed, 20 insertions, 7 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c
index c065c9e11bf..4cc342ac44b 100644
--- a/usr.bin/cvs/client.c
+++ b/usr.bin/cvs/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.20 2006/11/10 11:02:05 xsa Exp $ */
+/* $OpenBSD: client.c,v 1.21 2006/11/13 12:57:03 xsa Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -64,7 +64,7 @@ struct cvs_req cvs_requests[] = {
{ "diff", 0, cvs_server_diff, 0 },
{ "tag", 0, cvs_server_tag, 0 },
{ "status", 0, cvs_server_status, 0 },
- { "admin", 0, NULL, 0 },
+ { "admin", 0, cvs_server_admin, 0 },
{ "history", 0, NULL, 0 },
{ "watchers", 0, NULL, 0 },
{ "editors", 0, NULL, 0 },
diff --git a/usr.bin/cvs/cmd.c b/usr.bin/cvs/cmd.c
index 2629892e0e0..fbd1696b316 100644
--- a/usr.bin/cvs/cmd.c
+++ b/usr.bin/cvs/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.52 2006/07/07 17:37:17 joris Exp $ */
+/* $OpenBSD: cmd.c,v 1.53 2006/11/13 12:57:03 xsa Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -33,6 +33,7 @@ extern char *cvs_rootstr;
struct cvs_cmd *cvs_cdt[] = {
&cvs_cmd_add,
+ &cvs_cmd_admin,
&cvs_cmd_commit,
&cvs_cmd_checkout,
&cvs_cmd_diff,
@@ -41,12 +42,11 @@ struct cvs_cmd *cvs_cdt[] = {
&cvs_cmd_init,
&cvs_cmd_log,
&cvs_cmd_remove,
+ &cvs_cmd_server,
&cvs_cmd_status,
&cvs_cmd_tag,
&cvs_cmd_update,
- &cvs_cmd_server,
#if 0
- &cvs_cmd_admin,
&cvs_cmd_annotate,
&cvs_cmd_checkout,
&cvs_cmd_edit,
diff --git a/usr.bin/cvs/remote.h b/usr.bin/cvs/remote.h
index b695fe0562a..e8703d1d028 100644
--- a/usr.bin/cvs/remote.h
+++ b/usr.bin/cvs/remote.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: remote.h,v 1.4 2006/11/09 14:00:14 xsa Exp $ */
+/* $OpenBSD: remote.h,v 1.5 2006/11/13 12:57:03 xsa Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -72,6 +72,7 @@ void cvs_server_questionable(char *);
void cvs_server_argument(char *);
void cvs_server_add(char *);
+void cvs_server_admin(char *);
void cvs_server_commit(char *);
void cvs_server_diff(char *);
void cvs_server_init(char *);
diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c
index ac29c8ad1cd..a977afd9876 100644
--- a/usr.bin/cvs/server.c
+++ b/usr.bin/cvs/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.34 2006/11/09 14:00:14 xsa Exp $ */
+/* $OpenBSD: server.c,v 1.35 2006/11/13 12:57:03 xsa Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -389,6 +389,18 @@ cvs_server_add(char *data)
}
void
+cvs_server_admin(char *data)
+{
+ if (chdir(server_currentdir) == -1)
+ fatal("cvs_server_admin: %s", strerror(errno));
+
+ cvs_cmdop = CVS_OP_ADMIN;
+ cvs_admin(server_argc, server_argv);
+ cvs_server_send_response("ok");
+}
+
+
+void
cvs_server_commit(char *data)
{
if (chdir(server_currentdir) == -1)