public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* passt.c: incorrect signal() return value check
@ 2023-04-13 10:24 Valtteri Vuorikoski
  2023-04-13 11:25 ` Stefano Brivio
  0 siblings, 1 reply; 4+ messages in thread
From: Valtteri Vuorikoski @ 2023-04-13 10:24 UTC (permalink / raw)
  To: passt-dev

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)
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-13 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13 10:24 passt.c: incorrect signal() return value check Valtteri Vuorikoski
2023-04-13 11:25 ` Stefano Brivio
2023-04-13 14:47   ` Valtteri Vuorikoski
2023-04-13 17:46     ` Stefano Brivio

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).