From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from jkusti.notcom.org (jkusti.notcom.org [118.27.113.153]) by passt.top (Postfix) with ESMTPS id 848BB5A026D for ; Thu, 13 Apr 2023 12:24:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=notcom.org; s=jk; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date:Sender: Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=EPI6Zgk+MdrAm4UOIrbptvoxwfklS5PxtbPBILJ8tN0=; t=1681381482; x=1682245482; b=WXL52s0S2nWTKnKKbvZ6PW6pXsn8heRxQAtBkTdLzH1BDICHICgFZHOO828Z/YhTeEbxoEl4wSl NTQn8rGH8+2ySwuyX1SzO6wS5n+YdbDJ1oUiFXMIISISWysZcmzR4Dl7RCDqist96CHI31OHyW/ew GmlDO/mbj8LqO12g9890qx+eBe09mH/meY7zSq3aiAxerl2x3Thc71LAYQPUEtewQAW4W3o3Cm9TO DRAFIzcITHcfvno0IedHyU6aPPVb7rlkMC9nPNS/mqm6MyjSH3iIRAc9tLNt+AwqFa3tm2iALaDZE 4qqg9eh3JGAo+Nisw/lirncHwAS84a8mVXWw==; Received: from submission.internal (id=9cdceae8c7b5bf2d4c2c643b5341fa4197f0c084) by jkusti.notcom.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.x) (envelope-from ) id 1pmu86-000DTh-W9 for passt-dev@passt.top; Thu, 13 Apr 2023 10:24:39 +0000 Received: from a10d750d756b015054aa81d63d047a232e64e839 by sendhost.internal with local (Exim 4.x) (envelope-from ) id 1pmu82-003bQb-Av for passt-dev@passt.top; Thu, 13 Apr 2023 13:24:34 +0300 Date: Thu, 13 Apr 2023 13:24:34 +0300 From: Valtteri Vuorikoski To: passt-dev@passt.top Subject: passt.c: incorrect signal() return value check Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20230322-43-b46ca7 X-MailFrom: vuori@notcom.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation Message-ID-Hash: 6TJEDH5BIJOGULHTWW3WGKFSGVUDOR5W X-Message-ID-Hash: 6TJEDH5BIJOGULHTWW3WGKFSGVUDOR5W X-Mailman-Approved-At: Thu, 13 Apr 2023 13:11:37 +0200 X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: In current master, passt.c:main() has an incorrect check on signal() return value: if (sigaction(SIGCHLD, &sa, NULL) || signal(SIGPIPE, SIG_IGN)) die("Couldn't install signal handlers"); signal() returns SIG_ERR on failure or the previous setting if present. If a setting has been inherited from the parent (as is the case when starting from systemd with the default setting of IgnoreSIGPIPE=yes), the check will fail. The if statement should check for SIG_ERR for the SIGPIPE case, or alternatively switch to sigaction() since that's used for everything else in the code. -Valtteri (please cc on replies)