0b7db033c5
style(feuille.c): padding
2022-12-29 17:05:05 +01:00
40dfb78ef2
style(feuille.c): padding
2022-12-18 23:46:35 +01:00
de2c58196c
fix(feuille.c): pledge if using cosmopolitan libc
2022-12-11 02:12:30 +01:00
16f516d6ce
feat: cosmopolitan libc support
...
Added support for cosmopolitan libc.
Simply do `make COSMO=yes` and you'll get feuille.com, a working
αcτµαlly pδrταblε εxεcµταblε pastebin server.
+ version bump.
2022-12-11 01:59:08 +01:00
3c356481e1
fix: remove useless newlines
2022-12-11 00:42:30 +01:00
fdbbd73010
fix(feuille.c): check validity of sockets in accept loop
2022-12-11 00:41:39 +01:00
de702c9b58
fix(feuille.c): use {u,g}id_t instead of int for uid and gid
2022-11-29 14:31:29 +01:00
4b3b46e7ab
fix(feuille.c): initialize uid and gid to remove useless warnings
2022-11-29 14:28:16 +01:00
38b6f2ddc5
style(feuille.c): newline
2022-11-29 14:18:38 +01:00
8c30d271df
feat: use paste size instead of NULL byte in order to write the paste
...
Previously, the pastes were written to disk until feuille encountered
a NULL byte. This is now fixed.
+ version bump.
2022-11-29 13:57:11 +01:00
c69277655f
fix(feuille.c): error messages
2022-11-29 13:28:42 +01:00
47c337793d
fix(feuille.c): better root privileges drop and debug mode handling
2022-11-29 13:25:14 +01:00
f3fbb4c77f
feat(feuille.c): handle children exit codes
2022-11-29 11:30:29 +01:00
1694929221
fix(feuille.c): reorganize some of its code
2022-11-29 11:07:49 +01:00
4894825dac
fix(feuille.c): documentation (x2)
2022-11-29 10:54:07 +01:00
741800f7f3
fix(feuille.c): documentation
2022-11-29 10:53:11 +01:00
00e6fe5582
feat(feuille.c): accept_loop, better DEBUG mode, some style fixes
2022-11-29 10:49:39 +01:00
bf42903592
feat(feuille.c): do not create thread pool if in DEBUG mode
...
Will be useful when a batch of static/dynamic analysis tools will
check feuille's code.
2022-11-29 10:38:04 +01:00
43be904636
style: macros indentations (again)
2022-11-29 10:33:15 +01:00
bb9a60b240
style(feuille.c): minor padding fix
2022-11-29 10:28:56 +01:00
5ba58b1bd7
feat: reduce timeout, max file size, and use more workers by default
2022-11-29 10:27:56 +01:00
4867ff3468
chore: update headers
2022-11-28 20:36:41 +01:00
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
e3622822fb
fix(feuille.c): add TODO comment and fix style issue
2022-11-28 14:26:35 +01:00
6c57a4d03c
feat: safer `free()'s
...
`free' allocated buffers only on success inside the main loop, and
`free' them on error inside their respective functions
(fixes an UB where an already freed buffer is freed again in the main
loop)
2022-11-23 10:07:11 +01:00
24da772e56
feat: dissociate timeouts and empty pastes
...
feuille was handling those two errors the same way, by sending
`Timeout'd.' even if the client just sent an EOF.
2022-11-23 10:07:11 +01:00
7904d4dfc4
fix: use port 9999 instead of port 8888
...
web crawlers were creating a shit-ton of pastebins while trying to
connect to feuille.
2022-11-22 20:36:45 +01:00
d453de5108
fix(feuille.c): print non-root warning before running in background
2022-11-22 06:48:00 +01:00
58db0b6b33
fix(feuille.c): don't check user if not running as root
2022-11-22 06:45:46 +01:00
d2c3270b4b
fix(feuille.c): added some space around important blocks
2022-11-21 20:57:59 +01:00
e9009b9198
fix(feuille.c): background mode wasn't working when chrooted
...
freopen() could not find /dev/null but still closed std(in|out|err).
New sockets took the stdin file descriptor and broke everything.
Now it's fixed, and I even discovered the daemon() function.
2022-11-21 20:53:55 +01:00
7781c2b960
fix(feuille.c): pledge indentation
2022-11-21 19:44:41 +01:00
01057061f9
fix: use /var/www/feuille instead of /var/www/htdocs/feuille
2022-11-21 19:33:09 +01:00
fdf588e523
fix(feuille.c): pledge promises
2022-11-21 19:30:09 +01:00
601f8e4c24
fix(feuille.c): remove pledge stages 1 and 3
...
Stage 1 was causing issues with the chroot syscall, and, since stage
3 was causing more harm than security in terms of readability, I also
removed it.
2022-11-21 14:40:51 +01:00
8453d41a00
feat: First stable release
2022-11-21 10:43:22 +01:00