discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* man.cgi doesn't find symlinked manpages
@ 2022-04-04 17:25 Abigail G
  2022-04-08 15:49 ` Ingo Schwarze
  0 siblings, 1 reply; 4+ messages in thread
From: Abigail G @ 2022-04-04 17:25 UTC (permalink / raw)
  To: discuss

I'm working on tracking down an issue with the Void Linux instance of
man.cgi, man.voidlinux.org, which uses mandoc v1.14.6.

Manpages that are symlinks of other manpages are not included in the
results of a man.cgi search, returning 404, but are confirmed to exist
in the mandoc.db the cgi uses. An example of this is xlocate(1), which
is a symlink of xtools(1). `man xlocate`, `apropos xlocate`, and
`whatis xlocate` work fine locally on that host, but the same query via
cgi does not when using the 'man' button. Using the 'apropos' button
does, however.

I've narrowed it down to the following in pg_search() in cgi.c:

	if (req->isquery && req->q.equal && argc == 1)
		pg_redirect(req, argv[0]);
	else if (mansearch(&search, &paths, argc, argv, &res, &ressz)
== 0)
		pg_noresult(req, 400, "Bad Request",
		    "You entered an invalid query.");
	else if (ressz == 0)
		pg_noresult(req, 404, "Not Found", "No results
found.");
	else
		pg_searchres(req, res, ressz);

and the search mode that man.cgi is using (req->q.equal), which seem to
imply that mansearch() is not finding the symlink in its search because
of the mode of search that it is in.

Is this the intended behaviour? If so, can it be changed to match man,
apropos, and whatis? Not finding the page in one search method is a
bit unintuitive to me, at least.

-- 
Abigail G
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-09 18:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04 17:25 man.cgi doesn't find symlinked manpages Abigail G
2022-04-08 15:49 ` Ingo Schwarze
2022-04-09 15:59   ` Abigail G
2022-04-09 18:18     ` Ingo Schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).