openssh for UWIN

Corinna Vinschen vinschen at redhat.com
Sat Jun 8 07:41:23 EST 2002


On Fri, Jun 07, 2002 at 11:24:33PM +0200, Corinna Vinschen wrote:
> On Fri, Jun 07, 2002 at 10:52:48PM +0200, Markus Friedl wrote:
> > On Fri, Jun 07, 2002 at 11:09:39AM -0400, David Korn wrote:
> > > ! #if !defined(HAVE_CYGWIN) && !defined(_UWIN)
> > >   	extern uid_t original_real_uid;
> > >   	if (port < IPPORT_RESERVED && original_real_uid != 0)
> > 
> > i think these should be turned into a
> > 
> > #ifndef HAVE_IPPORT_RESERVED_CONCEPT
> > 	...
> > #endif
> 
> Ahem, do you mean
> 
>   #ifndef NO_IPPORT_RESERVED_CONCEPT
> 
> ?

Is the following patch acceptable?  The patch to serverloop.c
is completely new.  I've just seen that we missed that so far.

Corinna

Index: acconfig.h
===================================================================
RCS file: /cvs/openssh_cvs/acconfig.h,v
retrieving revision 1.137
diff -u -p -r1.137 acconfig.h
--- acconfig.h	13 May 2002 03:15:43 -0000	1.137
+++ acconfig.h	7 Jun 2002 21:42:12 -0000
@@ -310,6 +310,9 @@
 /* Define if X11 doesn't support AF_UNIX sockets on that system */
 #undef NO_X11_UNIX_SOCKETS
 
+/* Define if the concept of ports only accessible to superusers isn't known */
+#undef NO_IPPORT_RESERVED_CONCEPT
+
 /* Needed for SCO and NeXT */
 #undef BROKEN_SAVED_UIDS
 
Index: configure.ac
===================================================================
RCS file: /cvs/openssh_cvs/configure.ac,v
retrieving revision 1.65
diff -u -p -r1.65 configure.ac
--- configure.ac	7 Jun 2002 14:37:00 -0000	1.65
+++ configure.ac	7 Jun 2002 21:42:13 -0000
@@ -85,6 +85,7 @@ case "$host" in
 	AC_DEFINE(IPV4_DEFAULT)
 	AC_DEFINE(IP_TOS_IS_BROKEN)
 	AC_DEFINE(NO_X11_UNIX_SOCKETS)
+	AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
 	;;
 *-*-dgux*)
 	AC_DEFINE(IP_TOS_IS_BROKEN)
Index: readconf.c
===================================================================
RCS file: /cvs/openssh_cvs/readconf.c,v
retrieving revision 1.70
diff -u -p -r1.70 readconf.c
--- readconf.c	5 Feb 2002 01:26:35 -0000	1.70
+++ readconf.c	7 Jun 2002 21:42:15 -0000
@@ -200,7 +200,7 @@ add_local_forward(Options *options, u_sh
 		  u_short host_port)
 {
 	Forward *fwd;
-#ifndef HAVE_CYGWIN
+#ifndef NO_IPPORT_RESERVED_CONCEPT
 	extern uid_t original_real_uid;
 	if (port < IPPORT_RESERVED && original_real_uid != 0)
 		fatal("Privileged ports can only be forwarded by root.");
Index: serverloop.c
===================================================================
RCS file: /cvs/openssh_cvs/serverloop.c,v
retrieving revision 1.100
diff -u -p -r1.100 serverloop.c
--- serverloop.c	2 Apr 2002 20:48:20 -0000	1.100
+++ serverloop.c	7 Jun 2002 21:42:16 -0000
@@ -974,8 +974,11 @@ server_input_global_request(int type, u_
 
 		/* check permissions */
 		if (!options.allow_tcp_forwarding ||
-		    no_port_forwarding_flag ||
-		    (listen_port < IPPORT_RESERVED && pw->pw_uid != 0)) {
+		    no_port_forwarding_flag
+#ifndef NO_IPPORT_RESERVED_CONCEPT
+		    || (listen_port < IPPORT_RESERVED && pw->pw_uid != 0)
+#endif
+		   ) {
 			success = 0;
 			packet_send_debug("Server has disabled port forwarding.");
 		} else {



More information about the openssh-unix-dev mailing list