diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-01-25 21:30:38 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-01-25 21:30:38 +0000 |
commit | 7069823eddd2868011e847cc10ce82214a4bf533 (patch) | |
tree | bdb454189addea69efc36acf54e0528dc9ed52f8 | |
parent | 0670cc028cb3699bc3ffa7a94e6f2f47fab9747c (diff) |
never hand over a nonresv port, even if asked. problem reported by gmeinerj@ZUMtOBEL.co.at
-rw-r--r-- | lib/libc/net/rcmd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index 16ea9bc95ba..8029938df33 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -34,7 +34,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: rcmd.c,v 1.18 1996/09/05 02:37:27 millert Exp $"; +static char *rcsid = "$OpenBSD: rcmd.c,v 1.19 1997/01/25 21:30:37 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -260,7 +260,7 @@ rresvport(alport) if (s < 0) return (-1); sin.sin_port = htons((u_short)*alport); - if (*alport != IPPORT_RESERVED - 1) { + if (*alport < IPPORT_RESERVED - 1) { if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0) return (s); if (errno != EADDRINUSE) { |