summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorderaadt <>1997-01-25 21:30:37 +0000
committerderaadt <>1997-01-25 21:30:37 +0000
commiteb7f24371ddbc94cfb1137e3cb964f8a29b4b42c (patch)
tree03361b2c27e8b474a5dcc7a295bf19b4249e276d /src/lib
parentb5dff0b2f91db6e814ec0abfaf1a9d6f5d2b3dc1 (diff)
downloadopenbsd-eb7f24371ddbc94cfb1137e3cb964f8a29b4b42c.tar.gz
openbsd-eb7f24371ddbc94cfb1137e3cb964f8a29b4b42c.tar.bz2
openbsd-eb7f24371ddbc94cfb1137e3cb964f8a29b4b42c.zip
never hand over a nonresv port, even if asked. problem reported by gmeinerj@ZUMtOBEL.co.at
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/net/rcmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/net/rcmd.c b/src/lib/libc/net/rcmd.c
index 16ea9bc95b..8029938df3 100644
--- a/src/lib/libc/net/rcmd.c
+++ b/src/lib/libc/net/rcmd.c
@@ -34,7 +34,7 @@
34 */ 34 */
35 35
36#if defined(LIBC_SCCS) && !defined(lint) 36#if defined(LIBC_SCCS) && !defined(lint)
37static char *rcsid = "$OpenBSD: rcmd.c,v 1.18 1996/09/05 02:37:27 millert Exp $"; 37static char *rcsid = "$OpenBSD: rcmd.c,v 1.19 1997/01/25 21:30:37 deraadt Exp $";
38#endif /* LIBC_SCCS and not lint */ 38#endif /* LIBC_SCCS and not lint */
39 39
40#include <sys/param.h> 40#include <sys/param.h>
@@ -260,7 +260,7 @@ rresvport(alport)
260 if (s < 0) 260 if (s < 0)
261 return (-1); 261 return (-1);
262 sin.sin_port = htons((u_short)*alport); 262 sin.sin_port = htons((u_short)*alport);
263 if (*alport != IPPORT_RESERVED - 1) { 263 if (*alport < IPPORT_RESERVED - 1) {
264 if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0) 264 if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
265 return (s); 265 return (s);
266 if (errno != EADDRINUSE) { 266 if (errno != EADDRINUSE) {