From: Andreas Schneider Date: Tue, 24 Nov 2020 16:33:26 +0000 (+0100) Subject: s3:winbind: Check return code of set_blocking() X-Git-Tag: samba-4.14.0rc1~569 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7fa75b699335cb7832d412315ba8a3cdfc29debc;p=thirdparty%2Fsamba.git s3:winbind: Check return code of set_blocking() Found by covscan. Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index 3d8a567a6e4..c4899137665 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -1684,6 +1684,7 @@ static bool fork_domain_child(struct winbindd_child *child) if (child->pid != 0) { /* Parent */ ssize_t nread; + int rc; close(fdpair[0]); @@ -1714,9 +1715,15 @@ static bool fork_domain_child(struct winbindd_child *child) return false; } + rc = set_blocking(fdpair[1], false); + if (rc < 0) { + close(fdpair[1]); + return false; + } + child->sock = fdpair[1]; - set_blocking(child->sock, false); - return True; + + return true; } /* Child */