Important fix (sshd && binding). Portable version only.
Kevin Steves
stevesk at sweden.hp.com
Sun Feb 18 02:44:44 EST 2001
On Sat, 17 Feb 2001, Arkadiusz Miskiewicz wrote:
: If bind() fails we _always_ should close socket. I sent this patch while ago
: to djm but I still don't see this fix in openssh_cvs.
i don't know why the test for !ai->ai_next was added? anyone?
let's just sync with openbsd. commit?
Index: sshd.c
===================================================================
RCS file: /var/cvs/openssh/sshd.c,v
retrieving revision 1.120
diff -u -r1.120 sshd.c
--- sshd.c 2001/02/15 03:17:13 1.120
+++ sshd.c 2001/02/17 15:41:54
@@ -849,8 +849,7 @@
debug("Bind to port %s on %s.", strport, ntop);
/* Bind the socket to the desired port. */
- if ((bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) &&
- (!ai->ai_next)) {
+ if (bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) {
error("Bind to port %s on %s failed: %.200s.",
strport, ntop, strerror(errno));
close(listen_sock);
More information about the openssh-unix-dev
mailing list