.bay.de
Comment by ~rwa on ~sircmpwn/gmni
I think this is already fixed: https://git.sr.ht/~sircmpwn/gmni/tree/master/item/src/util.c#L85
Comment by ~rwa on ~sircmpwn/gmni
This issue probably also leads to the behaviour that lines with multibyte UTF-8 characters are wrapped too early cause every byte is counted as a char.
RESOLVED FIXED REPORTED
Comment by ~rwa on ~sircmpwn/gmni
Not fixed for me as of 02a386b5
Ticket created by ~rwa on ~sircmpwn/gmni
When gmnisrv tries to serve a cgi script that misses the +x permission for the gmnisrv user the following happens:
- error
execlp: Permission denied
is logged -> fine- no response to the client is sent -> should be a status 42 or more likely 50
- a
[defunct]
fork ofgmnisrv
stays as long as the main process is not closed
Comment by ~rwa on ~sircmpwn/gmni
I tracked it down to the special handling of cgi-enabled routes, when the requested file does not exist. But to be honest: i currently don't get behind the idea of this special handling, but there's a strange feeling it might be there for a reason.
diff --git a/src/serve.c b/src/serve.c index 74bb979..11bcb0c 100644 --- a/src/serve.c +++ b/src/serve.c @@ -398,32 +398,6 @@ serve_request(struct gmnisrv_client *client) struct stat st; while (true) { if ((n = stat(real_path, &st)) != 0) { - if (route->cgi) { - const char *new; - strcpy(temp_path, client_path); - new = basename((char *)temp_path); - - size_t l = strlen(new), q = strlen(pathinfo); - memmove(&pathinfo[l + 1], pathinfo, q); - pathinfo[0] = '/'; - memcpy(&pathinfo[1], new, l); - - strcpy(temp_path, client_path); - new = dirname((char *)temp_path); - strcpy(client_path, new); - - strcpy(temp_path, real_path); - new = dirname((char *)temp_path); - strcpy(real_path, new); - - if (route_match(route, client_path, &url_path)) { - n = snprintf(real_path, sizeof(real_path), - "%s%s", route->root, url_path); - assert((size_t)n < sizeof(real_path)); - continue; - } - } - client_submit_response(client, GEMINI_STATUS_NOT_FOUND, "Not found", NULL); return;
Ticket created by ~rwa on ~sircmpwn/gmni
gmnisrv "freezes" when you access a route with
cgi=on
, no index specified in the config and the called URI does not contain a path to a cgi script.E.g. you only have a
script.sh
in the root dir and callgemini://gemini.capsule
(instead ofgemini://gemini.capsule/script.sh
).Expected behaviour is to return a
51 NOT FOUND
.I assume currently it gets stuck in serve_request and does not respond to any request (no matter which route is accessed).