Commit Graph

547 Commits

Author SHA1 Message Date
Omar Polo
5aba63956a d->d_namelen doesn't seem to be available on linux 2021-04-25 12:45:17 +00:00
Omar Polo
e76f2c74b8 don't save the directory fd in c->pfd
scandir_fd already calls closedir, which in turns closes the fd
2021-04-25 12:19:06 +00:00
Omar Polo
11c986679a sort the auto index alphabetically 2021-04-25 12:06:54 +00:00
Omar Polo
bb4be662f1 specify the develop process 2021-04-25 12:01:34 +00:00
Omar Polo
072e3557c4 build gmid statically inside the docker container 2021-04-24 19:54:22 +00:00
Omar Polo
0bfdcb1799 missing comma , 2021-04-22 19:10:08 +00:00
Omar Polo
4d820b6cd2 use `text/x-patch' for .patch and .diff files 2021-04-21 07:51:29 +00:00
Omar Polo
5d1474a561 typo in comment 2021-04-20 09:53:33 +00:00
Omar Polo
3841a36930 restore signal handlers before exec'ing CGI scripts 2021-04-20 09:53:03 +00:00
Omar Polo
74c0c7e4ce rename reschedule_* to yield_* 2021-04-20 09:40:09 +00:00
Omar Polo
3f47867e1d typo... in the program name...
Just how retarded can I be?
2021-04-16 13:28:56 +00:00
Omar Polo
b7a9906151 typo 2021-04-15 20:14:18 +00:00
Omar Polo
dafaf46734 change description of `entrypoint' 2021-04-15 20:13:44 +00:00
Omar Polo
1de922891b typos 2021-04-15 19:43:46 +00:00
Omar Polo
548c2849fa hide output of etags
even the message "sh: etags: not such file or directory" or whatever
seems to be confusing for users, so silent it.

(maybe it would be better not to automatically generate the TAGS, but
it's so handy...)
2021-04-14 15:06:27 +00:00
Omar Polo
b33425827e print the datetime when logging to stderr 2021-04-14 14:52:47 +00:00
Omar Polo
89541eeec0 define TLS_VERSION, TLS_CIPHER and TLS_CIPHER_STRENGTH for CGI scripts 2021-04-13 06:59:54 +00:00
Omar Polo
b211d0f7d9 sync changelog 2021-04-12 21:13:51 +00:00
Omar Polo
9d092b607a fix IRI-parsing bug
Some particularly crafted IRIs can cause a denial of service (DOS).
IRIs which have a trailing `..' segment and resolve to a valid IRI
(i.e. a .. that's not escaping the root directory) will make the
server process loop forever.

This is """just""" an DOS vulnerability, it doesn't expose anything
sensitive or give an attacker anything else.
2021-04-12 20:11:47 +00:00
Omar Polo
f2522b4313 check if sys/queue.h provides TAILQ_FOREACH_SAFE 2021-03-31 16:52:07 +00:00
Omar Polo
b8e64ccd44 list instead of fixed-size array for vhosts and locations
saves some bytes of memory and removes the limit on the maximum number
of vhosts and location blocks.
2021-03-31 16:32:18 +00:00
Omar Polo
e0ebdf2d94 sync changelog 2021-03-31 13:58:31 +00:00
Omar Polo
7e1df73d7d fix mkdirs: create directories recursively 2021-03-31 13:56:58 +00:00
Omar Polo
33b455ada3 sync changes 2021-03-31 13:23:29 +00:00
Omar Polo
2ddc927113 mention the `static' target 2021-03-29 10:13:17 +00:00
Omar Polo
8b462a5d17 fix static target 2021-03-29 09:42:06 +00:00
Omar Polo
c836cdfadb handle CGI scripts that replies with the maximum header length allowed
the 1024 bytes limits is for the META only, not for the whole
response.  That means that the maximum size for the header line is
1029!
2021-03-29 09:42:06 +00:00
omar-polo
071dce449d
Add missing libevent-dev dependency
Merge pull request #2 from kornellapacz/master, thanks!
2021-03-29 11:01:38 +02:00
Korneliusz Łapacz
c928dcc7ba add missing libevent-dev dependency 2021-03-29 05:35:32 +02:00
Omar Polo
c8249bada3 gmid v1.6 -- "Stargazers" 2021-03-20 12:04:23 +00:00
Omar Polo
b890467e60 typo 2021-03-20 11:46:12 +00:00
Omar Polo
94be0bf03b update README 2021-03-20 11:08:17 +00:00
Omar Polo
8e09ee1d50 typo 2021-03-20 10:48:11 +00:00
Omar Polo
b9c9123b8e fix signal handling so it works on linux too
it seems that linux calls the signal handlers even when we're waiting
on sigwait for that signal.  Work around that.
2021-03-20 10:43:23 +00:00
Omar Polo
e3d81f49cc [seccomp] allow prlimit64
it's needed by getdtablesize, at least on glibc
2021-03-20 09:24:44 +00:00
Omar Polo
d632468df5 fix correct shutdown after SIG{INT,TERM} 2021-03-20 09:23:53 +00:00
Omar Polo
7e3aaf3752 sync changelog 2021-03-20 08:54:03 +00:00
Omar Polo
052c9d2403 kill only $pid during regress testing
before we did `pkill gmid', but that would influence also other
instances of gmid!
2021-03-20 08:51:58 +00:00
Omar Polo
1d3eb470b0 quit every process cleanly when receiving SIGINT or SIGTERM 2021-03-20 08:51:17 +00:00
Omar Polo
62e001b067 move all sandbox-related code to sandbox.c
while there, add capsicum for the logger process
2021-03-20 08:42:08 +00:00
Omar Polo
ad5301d1a0 sync ChangeLog 2021-03-20 07:46:47 +00:00
Omar Polo
bc99d868bc refactoring: imsg everywhere
use imsg to handle ALL kinds of IPC in gmid.  This simplifies and shorten the
code, and  makes everything more uniform too.
2021-03-19 19:21:29 +00:00
Omar Polo
1fbac5ba7c handle SIGHUP gracefully
i.e. don't print scary messages with LOG_CRIT priority!
2021-03-03 17:52:13 +00:00
Omar Polo
dbe262a45d split usage string into two lines 2021-03-03 17:51:42 +00:00
Omar Polo
de62c38d81 fix out-of-bounds access
obviously msg[datalen] is an off-by-one
2021-03-03 17:51:30 +00:00
Omar Polo
2c3e53dac6 give each server process its own socket for the executor
this fixes a bug introduced with the prefork mechanics: every server
process shared the same socket, and this would cause a race condition
when multiple server processes asked for a script cgi being executed.

This gives each server process its own socket to talk to the executor,
so the race cannot happen.
2021-03-03 17:22:01 +00:00
Omar Polo
fda7b99fc7 include sys/types.s to fix the build on OpenBSD 2021-02-23 14:07:49 +00:00
Omar Polo
290b5baa97 updated readme 2021-02-23 13:22:29 +00:00
Omar Polo
9899a837af
[seccomp] allow sendmsg 2021-02-23 13:44:20 +01:00
Omar Polo
17458f11e1
sync global variables 2021-02-23 13:44:20 +01:00