From: dtucker Date: Fri, 17 Jun 2022 01:00:03 +0000 (+0000) Subject: Log an error if pipe() fails while accepting a connection. bz#3447, from X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c725ecbf1b566e58f9d9e68bb02e3ca37ee2ec6e;p=openbsd Log an error if pipe() fails while accepting a connection. bz#3447, from vincent-openssh at vinc17 net, ok djm@ --- diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index 7a143d9613f..d6fbbef7741 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshd.c,v 1.585 2022/03/18 04:04:11 djm Exp $ */ +/* $OpenBSD: sshd.c,v 1.586 2022/06/17 01:00:03 dtucker Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1212,8 +1212,12 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) usleep(100 * 1000); continue; } - if (unset_nonblock(*newsock) == -1 || - pipe(startup_p) == -1) { + if (unset_nonblock(*newsock) == -1) { + close(*newsock); + continue; + } + if (pipe(startup_p) == -1) { + error_f("pipe(startup_p): %s", strerror(errno)); close(*newsock); continue; }