mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-13 17:18:06 -05:00
Minor tweaks to -nc:
- log host:port in event log - add -nc to Plink usage message [originally from svn r6825]
This commit is contained in:
parent
38ebd5f5ba
commit
74278dcd64
@ -76,6 +76,8 @@ use Plink:
|
|||||||
\c -m file read remote command(s) from file
|
\c -m file read remote command(s) from file
|
||||||
\c -s remote command is an SSH subsystem (SSH-2 only)
|
\c -s remote command is an SSH subsystem (SSH-2 only)
|
||||||
\c -N don't start a shell/command (SSH-2 only)
|
\c -N don't start a shell/command (SSH-2 only)
|
||||||
|
\c -nc host:port
|
||||||
|
\c open tunnel in place of session (SSH-2 only)
|
||||||
|
|
||||||
Once this works, you are ready to use Plink.
|
Once this works, you are ready to use Plink.
|
||||||
|
|
||||||
|
15
ssh.c
15
ssh.c
@ -7633,6 +7633,9 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
|
|||||||
ssh->mainchan = snew(struct ssh_channel);
|
ssh->mainchan = snew(struct ssh_channel);
|
||||||
ssh->mainchan->ssh = ssh;
|
ssh->mainchan->ssh = ssh;
|
||||||
ssh->mainchan->localid = alloc_channel_id(ssh);
|
ssh->mainchan->localid = alloc_channel_id(ssh);
|
||||||
|
logeventf(ssh,
|
||||||
|
"Opening direct-tcpip channel to %s:%d in place of session",
|
||||||
|
ssh->cfg.ssh_nc_host, ssh->cfg.ssh_nc_port);
|
||||||
s->pktout = ssh2_pkt_init(SSH2_MSG_CHANNEL_OPEN);
|
s->pktout = ssh2_pkt_init(SSH2_MSG_CHANNEL_OPEN);
|
||||||
ssh2_pkt_addstring(s->pktout, "direct-tcpip");
|
ssh2_pkt_addstring(s->pktout, "direct-tcpip");
|
||||||
ssh2_pkt_adduint32(s->pktout, ssh->mainchan->localid);
|
ssh2_pkt_adduint32(s->pktout, ssh->mainchan->localid);
|
||||||
@ -7642,13 +7645,9 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
|
|||||||
ssh2_pkt_addstring(s->pktout, ssh->cfg.ssh_nc_host);
|
ssh2_pkt_addstring(s->pktout, ssh->cfg.ssh_nc_host);
|
||||||
ssh2_pkt_adduint32(s->pktout, ssh->cfg.ssh_nc_port);
|
ssh2_pkt_adduint32(s->pktout, ssh->cfg.ssh_nc_port);
|
||||||
/*
|
/*
|
||||||
* We make up values for the originator data; partly it's
|
* There's nothing meaningful to put in the originator
|
||||||
* too much hassle to keep track, and partly I'm not
|
* fields, but some servers insist on syntactically correct
|
||||||
* convinced the server should be told details like that
|
* information.
|
||||||
* about my local network configuration.
|
|
||||||
* The "originator IP address" is syntactically a numeric
|
|
||||||
* IP address, and some servers (e.g., Tectia) get upset
|
|
||||||
* if it doesn't match this syntax.
|
|
||||||
*/
|
*/
|
||||||
ssh2_pkt_addstring(s->pktout, "0.0.0.0");
|
ssh2_pkt_addstring(s->pktout, "0.0.0.0");
|
||||||
ssh2_pkt_adduint32(s->pktout, 0);
|
ssh2_pkt_adduint32(s->pktout, 0);
|
||||||
@ -7673,7 +7672,7 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
|
|||||||
bufchain_init(&ssh->mainchan->v.v2.outbuffer);
|
bufchain_init(&ssh->mainchan->v.v2.outbuffer);
|
||||||
add234(ssh->channels, ssh->mainchan);
|
add234(ssh->channels, ssh->mainchan);
|
||||||
update_specials_menu(ssh->frontend);
|
update_specials_menu(ssh->frontend);
|
||||||
logevent("Opened direct-tcpip channel in place of session");
|
logevent("Opened direct-tcpip channel");
|
||||||
ssh->ncmode = TRUE;
|
ssh->ncmode = TRUE;
|
||||||
} else {
|
} else {
|
||||||
ssh->mainchan = snew(struct ssh_channel);
|
ssh->mainchan = snew(struct ssh_channel);
|
||||||
|
@ -534,6 +534,8 @@ static void usage(void)
|
|||||||
printf(" -m file read remote command(s) from file\n");
|
printf(" -m file read remote command(s) from file\n");
|
||||||
printf(" -s remote command is an SSH subsystem (SSH-2 only)\n");
|
printf(" -s remote command is an SSH subsystem (SSH-2 only)\n");
|
||||||
printf(" -N don't start a shell/command (SSH-2 only)\n");
|
printf(" -N don't start a shell/command (SSH-2 only)\n");
|
||||||
|
printf(" -nc host:port\n");
|
||||||
|
printf(" open tunnel in place of session (SSH-2 only)\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,6 +179,8 @@ static void usage(void)
|
|||||||
printf(" -m file read remote command(s) from file\n");
|
printf(" -m file read remote command(s) from file\n");
|
||||||
printf(" -s remote command is an SSH subsystem (SSH-2 only)\n");
|
printf(" -s remote command is an SSH subsystem (SSH-2 only)\n");
|
||||||
printf(" -N don't start a shell/command (SSH-2 only)\n");
|
printf(" -N don't start a shell/command (SSH-2 only)\n");
|
||||||
|
printf(" -nc host:port\n");
|
||||||
|
printf(" open tunnel in place of session (SSH-2 only)\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user