summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2016-10-18 17:32:54 +0000
committerDarren Tucker <dtucker@zip.com.au>2016-10-19 07:16:01 +1100
commit246aa842a4ad368d8ce030495e657ef3a0e1f95c (patch)
treec6c82ee881b08ce78672f2e8bda687f24a3fef4a /channels.c
parent2c6697c443d2c9c908260eed73eb9143223e3ec9 (diff)
upstream commit
Remove channel_input_port_forward_request(); the only caller was the recently-removed SSH1 server code so it's now dead code. ok markus@ Upstream-ID: 05453983230a1f439562535fec2818f63f297af9
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c41
1 files changed, 1 insertions, 40 deletions
diff --git a/channels.c b/channels.c
index fecd4540e..bef8ad6aa 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.c,v 1.355 2016/09/30 20:24:46 djm Exp $ */ 1/* $OpenBSD: channels.c,v 1.356 2016/10/18 17:32:54 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -3806,45 +3806,6 @@ channel_request_rforward_cancel(struct Forward *fwd)
3806} 3806}
3807 3807
3808/* 3808/*
3809 * This is called after receiving CHANNEL_FORWARDING_REQUEST. This initates
3810 * listening for the port, and sends back a success reply (or disconnect
3811 * message if there was an error).
3812 */
3813int
3814channel_input_port_forward_request(int is_root, struct ForwardOptions *fwd_opts)
3815{
3816 int success = 0;
3817 struct Forward fwd;
3818
3819 /* Get arguments from the packet. */
3820 memset(&fwd, 0, sizeof(fwd));
3821 fwd.listen_port = packet_get_int();
3822 fwd.connect_host = packet_get_string(NULL);
3823 fwd.connect_port = packet_get_int();
3824
3825#ifndef HAVE_CYGWIN
3826 /*
3827 * Check that an unprivileged user is not trying to forward a
3828 * privileged port.
3829 */
3830 if (fwd.listen_port < IPPORT_RESERVED && !is_root)
3831 packet_disconnect(
3832 "Requested forwarding of port %d but user is not root.",
3833 fwd.listen_port);
3834 if (fwd.connect_port == 0)
3835 packet_disconnect("Dynamic forwarding denied.");
3836#endif
3837
3838 /* Initiate forwarding */
3839 success = channel_setup_local_fwd_listener(&fwd, fwd_opts);
3840
3841 /* Free the argument string. */
3842 free(fwd.connect_host);
3843
3844 return (success ? 0 : -1);
3845}
3846
3847/*
3848 * Permits opening to any host/port if permitted_opens[] is empty. This is 3809 * Permits opening to any host/port if permitted_opens[] is empty. This is
3849 * usually called by the server, because the user could connect to any port 3810 * usually called by the server, because the user could connect to any port
3850 * anyway, and the server has no way to know but to trust the client anyway. 3811 * anyway, and the server has no way to know but to trust the client anyway.