fix(feuille.c): ignore SIGPIPE errors

feuille was being killed by SIGPIPE when it tried to send data to an
already closed socket (e.g. when someone did a nmap scan on feuille's
port.)
This commit is contained in:
Tom MTT. 2022-11-28 20:29:43 +01:00
parent aeee552947
commit 42cdd1e16d

View file

@ -270,6 +270,11 @@ int main(int argc, char *argv[])
daemon(1, 0);
}
/* ignore most signals that could kill feuille */
verbose(3, "ignoring signals that could kill feuille...");
signal(SIGPIPE, SIG_IGN); /* when send(2) or write(2) fails */
/* chroot and drop root permissions */
if (getuid() == 0) {