Bugzilla – Attachment 494 Details for
Bug 756
sshd does not support global request cancel-tcpip-forward
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Attempt at cancel-tcpip-forward support
canceltcp.diff (text/plain), 2.31 KB, created by
Damien Miller
on 2003-11-08 21:32:34 AEDT
(
hide
)
Description:
Attempt at cancel-tcpip-forward support
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2003-11-08 21:32:34 AEDT
Size:
2.31 KB
patch
obsolete
>Index: channels.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/channels.c,v >retrieving revision 1.197 >diff -u -r1.197 channels.c >--- channels.c 23 Sep 2003 20:41:11 -0000 1.197 >+++ channels.c 9 Nov 2003 04:36:47 -0000 >@@ -2206,6 +2206,27 @@ > return success; > } > >+int >+channel_cancel_rport_listener(const char *host, u_short port) >+{ >+ int i, found = 0; >+ >+ for(i = 0; i < channels_alloc; i++) { >+ Channel *c = channels[i]; >+ >+ /* XXX - ambiguity due to possible name truncation */ >+ if (c != NULL && c->type == SSH_CHANNEL_RPORT_LISTENER && >+ strncmp(c->path, host, sizeof(c->path)) == 0 && >+ c->host_port == port) { >+ debug2("%s: close clannel %d", __func__, i); >+ channel_free(c); >+ found = 1; >+ } >+ } >+ >+ return (found); >+} >+ > /* protocol local port fwd, used by ssh (and sshd in v1) */ > int > channel_setup_local_fwd_listener(u_short listen_port, >Index: channels.h >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/channels.h,v >retrieving revision 1.71 >diff -u -r1.71 channels.h >--- channels.h 23 Sep 2003 20:41:11 -0000 1.71 >+++ channels.h 9 Nov 2003 04:36:47 -0000 >@@ -201,6 +201,7 @@ > void channel_request_remote_forwarding(u_short, const char *, u_short); > int channel_setup_local_fwd_listener(u_short, const char *, u_short, int); > int channel_setup_remote_fwd_listener(const char *, u_short, int); >+int channel_cancel_rport_listener(const char *, u_short); > > /* x11 forwarding */ > >Index: serverloop.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/serverloop.c,v >retrieving revision 1.112 >diff -u -r1.112 serverloop.c >--- serverloop.c 4 Nov 2003 08:54:09 -0000 1.112 >+++ serverloop.c 9 Nov 2003 04:36:50 -0000 >@@ -990,6 +990,17 @@ > listen_address, listen_port, options.gateway_ports); > } > xfree(listen_address); >+ } else if (strcmp(rtype, "cancel-tcpip-forward") == 0) { >+ char *cancel_address; >+ u_short cancel_port; >+ >+ cancel_address = packet_get_string(NULL); >+ cancel_port = (u_short)packet_get_int(); >+ debug("server_input_global_request: cancel-tcpip-forward addr %s port %d", >+ cancel_address, cancel_port); >+ >+ success = channel_cancel_rport_listener(cancel_address, >+ cancel_port); > } > if (want_reply) { > packet_start(success ?
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 756
:
494
|
505
|
579
|
580