Compare commits

..

3 commits

Author SHA1 Message Date
Tom MTT
7c796a567f fix(.gitignore): remove .clangd from ignored files 2022-11-28 20:31:30 +01:00
Tom MTT
8780761486 style(server.c): minor fix 2022-11-28 20:31:09 +01:00
Tom MTT
42cdd1e16d 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.)
2022-11-28 20:29:43 +01:00
3 changed files with 6 additions and 3 deletions

2
.gitignore vendored
View file

@ -1,5 +1,3 @@
.clangd
*.o
feuille

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

View file

@ -221,7 +221,7 @@ char *read_paste(int connection)
if (total_size == 0) {
/* yup, free the buffer and return an error */
if (errno != EAGAIN)
errno = ENOENT;
errno = ENOENT;
free(buffer);
return NULL;