summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2007-09-10 14:06:15 +0000
committerJoris Vink <joris@cvs.openbsd.org>2007-09-10 14:06:15 +0000
commite617d3130f4ee9ff3df5781cfc30d5a8c8d9a52c (patch)
treedca8c3c27957b2046770d407d5398e5ddbcaeca3 /usr.bin
parentb14b87d182b30166aaaee000506e869c4d1ebe8a (diff)
Allow port specification in our CVSROOT which is used for our
ssh connection to our server. Example: joris@somehost.com:2222:/cvs OK tobias@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/client.c7
-rw-r--r--usr.bin/cvs/cvs.h4
-rw-r--r--usr.bin/cvs/root.c6
3 files changed, 12 insertions, 5 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c
index c93d95bbadc..0902ef60bc0 100644
--- a/usr.bin/cvs/client.c
+++ b/usr.bin/cvs/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.77 2007/09/07 19:36:05 tobias Exp $ */
+/* $OpenBSD: client.c,v 1.78 2007/09/10 14:06:14 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -234,6 +234,11 @@ cvs_client_connect_to_server(void)
argv[argc++] = current_cvsroot->cr_user;
}
+ if (current_cvsroot->cr_port != NULL) {
+ argv[argc++] = "-p";
+ argv[argc++] = current_cvsroot->cr_port;
+ }
+
argv[argc++] = current_cvsroot->cr_host;
argv[argc++] = cmd;
argv[argc++] = "server";
diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h
index 8c6d7d6742f..693ace54f6a 100644
--- a/usr.bin/cvs/cvs.h
+++ b/usr.bin/cvs/cvs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cvs.h,v 1.143 2007/09/04 19:07:03 tobias Exp $ */
+/* $OpenBSD: cvs.h,v 1.144 2007/09/10 14:06:14 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -208,7 +208,7 @@ struct cvsroot {
char *cr_pass;
char *cr_host;
char *cr_dir;
- u_int cr_port;
+ char *cr_port;
/* connection data */
u_int cr_flags;
diff --git a/usr.bin/cvs/root.c b/usr.bin/cvs/root.c
index b7e49870709..9ca716e0596 100644
--- a/usr.bin/cvs/root.c
+++ b/usr.bin/cvs/root.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: root.c,v 1.41 2007/09/02 12:13:00 tobias Exp $ */
+/* $OpenBSD: root.c,v 1.42 2007/09/10 14:06:14 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -133,10 +133,12 @@ cvsroot_parse(const char *str)
pp = strchr(sp, ':');
if (pp != NULL) {
*(pp++) = '\0';
- root->cr_port = strtonum(pp, 1, 65535, &errstr);
+
+ i = strtonum(pp, 1, 65535, &errstr);
if (errstr != NULL)
fatal("port specification in CVSROOT is %s", errstr);
+ root->cr_port = pp;
}
root->cr_host = sp;