[openssh-commits] [openssh] 01/01: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Oct 19 07:16:21 AEDT 2016


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 246aa842a4ad368d8ce030495e657ef3a0e1f95c
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Tue Oct 18 17:32:54 2016 +0000

    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
---
 channels.c                    | 41 +----------------------------------------
 channels.c => channels.c.orig |  2 --
 channels.c.rej                |  8 ++++++++
 channels.h                    |  3 +--
 channels.h => channels.h.orig |  0
 channels.h.rej                | 16 ++++++++++++++++
 6 files changed, 26 insertions(+), 44 deletions(-)

diff --git a/channels.c b/channels.c
index fecd454..bef8ad6 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.355 2016/09/30 20:24:46 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.356 2016/10/18 17:32:54 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -3806,45 +3806,6 @@ channel_request_rforward_cancel(struct Forward *fwd)
 }
 
 /*
- * This is called after receiving CHANNEL_FORWARDING_REQUEST.  This initates
- * listening for the port, and sends back a success reply (or disconnect
- * message if there was an error).
- */
-int
-channel_input_port_forward_request(int is_root, struct ForwardOptions *fwd_opts)
-{
-	int success = 0;
-	struct Forward fwd;
-
-	/* Get arguments from the packet. */
-	memset(&fwd, 0, sizeof(fwd));
-	fwd.listen_port = packet_get_int();
-	fwd.connect_host = packet_get_string(NULL);
-	fwd.connect_port = packet_get_int();
-
-#ifndef HAVE_CYGWIN
-	/*
-	 * Check that an unprivileged user is not trying to forward a
-	 * privileged port.
-	 */
-	if (fwd.listen_port < IPPORT_RESERVED && !is_root)
-		packet_disconnect(
-		    "Requested forwarding of port %d but user is not root.",
-		    fwd.listen_port);
-	if (fwd.connect_port == 0)
-		packet_disconnect("Dynamic forwarding denied.");
-#endif
-
-	/* Initiate forwarding */
-	success = channel_setup_local_fwd_listener(&fwd, fwd_opts);
-
-	/* Free the argument string. */
-	free(fwd.connect_host);
-
-	return (success ? 0 : -1);
-}
-
-/*
  * Permits opening to any host/port if permitted_opens[] is empty.  This is
  * usually called by the server, because the user could connect to any port
  * anyway, and the server has no way to know but to trust the client anyway.
diff --git a/channels.c b/channels.c.orig
similarity index 99%
copy from channels.c
copy to channels.c.orig
index fecd454..ab2d998 100644
--- a/channels.c
+++ b/channels.c.orig
@@ -3822,7 +3822,6 @@ channel_input_port_forward_request(int is_root, struct ForwardOptions *fwd_opts)
 	fwd.connect_host = packet_get_string(NULL);
 	fwd.connect_port = packet_get_int();
 
-#ifndef HAVE_CYGWIN
 	/*
 	 * Check that an unprivileged user is not trying to forward a
 	 * privileged port.
@@ -3833,7 +3832,6 @@ channel_input_port_forward_request(int is_root, struct ForwardOptions *fwd_opts)
 		    fwd.listen_port);
 	if (fwd.connect_port == 0)
 		packet_disconnect("Dynamic forwarding denied.");
-#endif
 
 	/* Initiate forwarding */
 	success = channel_setup_local_fwd_listener(&fwd, fwd_opts);
diff --git a/channels.c.rej b/channels.c.rej
new file mode 100644
index 0000000..b53ea3b
--- /dev/null
+++ b/channels.c.rej
@@ -0,0 +1,8 @@
+--- channels.c
++++ channels.c
+@@ -1,4 +1,4 @@
+-/* $OpenBSD: channels.c,v 1.355 2016/09/30 20:24:46 djm Exp $ */
++/* $OpenBSD: channels.c,v 1.356 2016/10/18 17:32:54 dtucker Exp $ */
+ /*
+  * Author: Tatu Ylonen <ylo at cs.hut.fi>
+  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
diff --git a/channels.h b/channels.h
index 95363e9..09c3c36 100644
--- a/channels.h
+++ b/channels.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.h,v 1.119 2016/09/30 09:19:13 markus Exp $ */
+/* $OpenBSD: channels.h,v 1.120 2016/10/18 17:32:54 dtucker Exp $ */
 
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
@@ -275,7 +275,6 @@ void	 channel_update_permitted_opens(int, int);
 void	 channel_clear_permitted_opens(void);
 void	 channel_clear_adm_permitted_opens(void);
 void 	 channel_print_adm_permitted_opens(void);
-int      channel_input_port_forward_request(int, struct ForwardOptions *);
 Channel	*channel_connect_to_port(const char *, u_short, char *, char *);
 Channel *channel_connect_to_path(const char *, char *, char *);
 Channel	*channel_connect_stdio_fwd(const char*, u_short, int, int);
diff --git a/channels.h b/channels.h.orig
similarity index 100%
copy from channels.h
copy to channels.h.orig
diff --git a/channels.h.rej b/channels.h.rej
new file mode 100644
index 0000000..6e08ec6
--- /dev/null
+++ b/channels.h.rej
@@ -0,0 +1,16 @@
+--- channels.h
++++ channels.h
+@@ -1,4 +1,4 @@
+-/* $OpenBSD: channels.h,v 1.119 2016/09/30 09:19:13 markus Exp $ */
++/* $OpenBSD: channels.h,v 1.120 2016/10/18 17:32:54 dtucker Exp $ */
+ 
+ /*
+  * Author: Tatu Ylonen <ylo at cs.hut.fi>
+@@ -272,7 +272,6 @@ void	 channel_update_permitted_opens(int, int);
+ void	 channel_clear_permitted_opens(void);
+ void	 channel_clear_adm_permitted_opens(void);
+ void 	 channel_print_adm_permitted_opens(void);
+-int      channel_input_port_forward_request(int, struct ForwardOptions *);
+ Channel	*channel_connect_to_port(const char *, u_short, char *, char *);
+ Channel *channel_connect_to_path(const char *, char *, char *);
+ Channel	*channel_connect_stdio_fwd(const char*, u_short, int, int);

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list