freebsd-ports/security/ssh2/files/patch-al
Peter Wemm 4f8ec254e4 Have ssh use rresvport() to get a privileged socket instead of doing it
itself.  This means it obeys the portrange sysctl's.
1996-08-12 14:17:53 +00:00

27 lines
617 B
Plaintext

*** sshconnect.c.dist Thu Jun 6 21:47:06 1996
--- sshconnect.c Mon Aug 12 13:26:46 1996
***************
*** 235,240 ****
--- 235,245 ----
{
struct sockaddr_in sin;
int p;
+ #if defined(__FreeBSD__) && !defined(SOCKS)
+ sock = rresvport(&p);
+ if (sock < 0)
+ fatal("rresvport: %.100s", strerror(errno));
+ #else
for (p = 1023; p > 512; p--)
{
sock = socket(AF_INET, SOCK_STREAM, 0);
***************
*** 262,267 ****
--- 267,273 ----
}
fatal("bind: %.100s", strerror(errno));
}
+ #endif
debug("Allocated local port %d.", p);
}
else