[PATCH]: Eliminate HAVE_CYGWIN (and _UWIN) around calls to setgroups() [was Re: openssh for UWIN]

Corinna Vinschen vinschen at redhat.com
Fri Jun 14 04:25:32 EST 2002


On Wed, Jun 12, 2002 at 11:54:46AM -0500, Ben Lindstrom wrote:
> there are three other IPPORT Reserved sections.
> 
> One in serverloop.c and one in sshconnect.c and a two-fer in sshd.c

The serverloop.c was already included in my patch from 2002-06-08,
the other two are ok as they are.  I resend the cleaned up patch
relative to cvs HEAD

Corinna

Index: acconfig.h
===================================================================
RCS file: /cvs/openssh_cvs/acconfig.h,v
retrieving revision 1.138
diff -u -p -r1.138 acconfig.h
--- acconfig.h	12 Jun 2002 16:57:15 -0000	1.138
+++ acconfig.h	13 Jun 2002 18:05:13 -0000
@@ -313,6 +313,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: channels.c
===================================================================
RCS file: /cvs/openssh_cvs/channels.c,v
retrieving revision 1.148
diff -u -p -r1.148 channels.c
--- channels.c	11 Jun 2002 15:59:03 -0000	1.148
+++ channels.c	13 Jun 2002 18:05:25 -0000
@@ -2180,7 +2180,7 @@ channel_input_port_forward_request(int i
 	hostname = packet_get_string(NULL);
 	host_port = packet_get_int();
 
-#ifndef HAVE_CYGWIN
+#ifndef NO_IPPORT_RESERVED_CONCEPT
 	/*
 	 * Check that an unprivileged user is not trying to forward a
 	 * privileged port.
Index: configure.ac
===================================================================
RCS file: /cvs/openssh_cvs/configure.ac,v
retrieving revision 1.66
diff -u -p -r1.66 configure.ac
--- configure.ac	12 Jun 2002 16:57:15 -0000	1.66
+++ configure.ac	13 Jun 2002 18:05:31 -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)
 	AC_DEFINE(SETGROUPS_NOOP)
 	;;
 *-*-dgux*)
Index: readconf.c
===================================================================
RCS file: /cvs/openssh_cvs/readconf.c,v
retrieving revision 1.74
diff -u -p -r1.74 readconf.c
--- readconf.c	11 Jun 2002 15:53:07 -0000	1.74
+++ readconf.c	13 Jun 2002 18:05:31 -0000
@@ -199,7 +199,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.101
diff -u -p -r1.101 serverloop.c
--- serverloop.c	11 Jun 2002 16:42:49 -0000	1.101
+++ serverloop.c	13 Jun 2002 18:05:33 -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
+#ifdef NO_IPPORT_RESERVED_CONCEPT
+		    || (listen_port < IPPORT_RESERVED && pw->pw_uid != 0)
+#endif
+		   ) {
 			success = 0;
 			packet_send_debug("Server has disabled port forwarding.");
 		} else {

-- 
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen at redhat.com



More information about the openssh-unix-dev mailing list