~rwa

.bay.de

https://clttr.info

mostly "ops", sometimes doing some "dev" just for the fun of it

Gemini Space


#64 gmnlm "eats" last line of response 21 days ago

Ticket created by ~rwa on ~sircmpwn/gmni

built with commit 0b55ef24:

  • gmni gemini://geminispace.info shows > Index updated on: ... as the last line
  • gmnlm gemini://geminispace.info shows an empty line as last line, `> Index updated on: ..." is missing

#61 configure does not check bearssl 4 months ago

Comment by ~rwa on ~sircmpwn/gmni

bearssl is available as an AUR package: https://aur.archlinux.org/packages/bearssl/

#41 Possible buffer overflows in download_resp 6 months ago

Comment by ~rwa on ~sircmpwn/gmni

#21 Don't split UTF-8 chars across lines 7 months ago

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.

#47 gmnisrv: improve cgi handling when x permission is missing 7 months ago

on ~sircmpwn/gmni

REPORTED RESOLVED FIXED

#46 gmnisrv: "freeze" when a cgi-enabled URI is accessed with missing index file 8 months ago

on ~sircmpwn/gmni

RESOLVED FIXED REPORTED

#46 gmnisrv: "freeze" when a cgi-enabled URI is accessed with missing index file 8 months ago

Comment by ~rwa on ~sircmpwn/gmni

Not fixed for me as of 02a386b5

#47 gmnisrv: improve cgi handling when x permission is missing 8 months ago

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 of gmnisrv stays as long as the main process is not closed

#46 gmnisrv: "freeze" when a cgi-enabled URI is accessed with missing index file 8 months ago

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;