As I mentioned, my is need to connect to different local ports that
represent difference CVS servers. So I needed a way to set CVS_AUTH_PORT to
different values. I've done this by adding a '-p' parameter to the CVS
client. For those who are interested, I've attached a diff from the latest
CVS.
"Damon C. Richardson" wrote:
> You have to go into the code and change the default port in the header
> and the code. It's really ugly the way they trap you into the 2401
> port.
>
> Damon
>
> Bob Bell wrote:
> >
> > Is there an existing way to tell the client to connect to a
> > different port on a CVSROOT-basis? CVS_AUTH_PORT won't cut it for me,
> > unless I compile different versions of the cvs client for each port
> > I want to connect to (ick).
> >
> > To be specific, I'm stuck behind a firewall. We do have a machine
> > that we can telnet to, and then telnet out from there. I've written a
> > program that connects to a local port on my machine. When it receives a
> > connection, it connects to the gateway, logs in, and then connects out
> > from there. It then relays all traffic, similar to netcat.
> >
> > It's been tricky, but I have it working for telnet, ssh, cvs, and
> > presumably anything else. What that means is that I set up a local port
> > for each remote machine and port I want to connect to. If I want to
> > access more than one CVS server, it need to be able to point the cvs
> > client to the specific local port.
> >
> > Please let me know if this is possible. Since it doesn't seem to
> > be, I'm hacking my client right now (gotta love open source!).
> >
> > --
> > Bob Bell Compaq Computer Corporation
> > Software Engineer 110 Spit Brook Rd - ZKO3-3U/14
> > TruCluster Group Nashua, NH 03062-2698
> > [EMAIL PROTECTED] 603-884-0595
--
Bob Bell Compaq Computer Corporation
Software Engineer 110 Spit Brook Rd - ZKO3-3U/14
TruCluster Group Nashua, NH 03062-2698
[EMAIL PROTECTED] 603-884-0595
Index: main.c
===================================================================
RCS file: /home2/cvsroot/ccvs/src/main.c,v
retrieving revision 1.146
diff -c -r1.146 main.c
*** main.c 2000/03/23 21:01:40 1.146
--- main.c 2000/04/21 16:45:37
***************
*** 42,47 ****
--- 42,48 ----
int trace = 0;
int noexec = 0;
int logoff = 0;
+ int authport = -1;
/* Set if we should be writing CVSADM directories at top level. At
least for now we'll make the default be off (the CVS 1.9, not CVS
***************
*** 601,606 ****
--- 602,614 ----
CVSroot = xstrdup (optarg);
free_CVSroot = 1;
cvs_update_env = 1; /* need to update environment */
+ break;
+ case 'p':
+ #ifdef CLIENT_SUPPORT
+ authport = atoi(optarg);
+ if (authport == INT_MAX || authport == INT_MIN)
+ error (1, 0, "invalid port specified");
+ #endif
break;
case 'H':
help = 1;
Index: client.c
===================================================================
RCS file: /home2/cvsroot/ccvs/src/client.c,v
retrieving revision 1.276
diff -c -r1.276 client.c
*** client.c 2000/01/05 16:35:45 1.276
--- client.c 2000/04/21 16:45:37
***************
*** 95,100 ****
--- 95,102 ----
static int connect_to_gserver PROTO((int, struct hostent *));
#endif /* HAVE_GSSAPI */
+
+ extern int authport;
static void add_prune_candidate PROTO((char *));
***************
*** 3659,3665 ****
{
struct servent *s = getservbyname ("cvspserver", "tcp");
! if (s)
return ntohs (s->s_port);
else
return CVS_AUTH_PORT;
--- 3661,3669 ----
{
struct servent *s = getservbyname ("cvspserver", "tcp");
! if (authport != -1)
! return authport;
! else if (s)
return ntohs (s->s_port);
else
return CVS_AUTH_PORT;