You are not logged in.

#1 2017-09-07 13:10:50

Registered: 2010-05-16
Posts: 98

Gofish gopher HTTP gateway: error 500 on directories

I am trying to use the HTTP gateway of the GoFish gopher server, installed from AUR. I am testing it locally (start the service and point my browser to and it works well for regular files. For directories (top-level or below) however I only get an error:

500 Server Error

An internal server error occurred. Try again later.

journalctl logs an error like the following each time:

gofish[16826]: /tmp/.gofish-gwEf2L: No such file or directory

According to the instructions in "/srv/gopher/Configure_GoFish", which is installed with the package, "Directory menus and plain text files are converted to html." So directories are supposed to work.

I had a look at the source code [1], and I believe (I could be wrong) the error occurs at a call of "mkstemp" on line 355 of http.c:

static int http_directory(struct connection *conn, int fd, char *dir)
	int out;
	char buffer[BUFSIZE + 1], outname[80];
	char url[256];
	char *buf, *p, *s;
	int n, len, left;

	snprintf(outname, sizeof(outname), "%s/.gofish-XXXXXX", tmpdir);
	out = mkstemp(outname);
	if (out == -1) {
		syslog(LOG_ERR, "%s: %m", outname);
		return -1;

For some reason, apparently, mkstemp fails to create a temporary file. Why?

Next I had a look at the service file provided by the AUR package [2]. It has a few lines in it which, a comment explains, "Lock [the] process down":

# Lock process down

I suspected that one of them was preventing gofish from writing to /tmp, so I uncommented first some, then all of them, each time calling "systemctl daemon-reload" and "systemctl restart gofish" – no change in behaviour.

I realise this is a pretty obscure topic, but maybe somebody has an idea.

[1] … 1.2.tar.gz
[2] … e?h=gofish

Last edited by Franek (2017-09-07 13:14:36)


Board footer

Powered by FluxBB