From: Valtteri Vuorikoski <vuori@notcom.org>
To: passt-dev@passt.top
Subject: passt.c: incorrect signal() return value check
Date: Thu, 13 Apr 2023 13:24:34 +0300 [thread overview]
Message-ID: <dkohynau5ny3kcdrqb74mkhv4v2bdhc4f3akogg7kimwqix2il@hlgv6l4q7xr6> (raw)
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)
next reply other threads:[~2023-04-13 10:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-13 10:24 Valtteri Vuorikoski [this message]
2023-04-13 11:25 ` passt.c: incorrect signal() return value check Stefano Brivio
2023-04-13 14:47 ` Valtteri Vuorikoski
2023-04-13 17:46 ` Stefano Brivio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dkohynau5ny3kcdrqb74mkhv4v2bdhc4f3akogg7kimwqix2il@hlgv6l4q7xr6 \
--to=vuori@notcom.org \
--cc=passt-dev@passt.top \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).