discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Abigail G <dev@kb6.ee>
To: discuss@mandoc.bsd.lv
Subject: man.cgi doesn't find symlinked manpages
Date: Mon, 04 Apr 2022 13:25:13 -0400	[thread overview]
Message-ID: <d30674560026e12b0ac779c289e7cd862cd3869d.camel@kb6.ee> (raw)

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


             reply	other threads:[~2022-04-04 17:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04 17:25 Abigail G [this message]
2022-04-08 15:49 ` Ingo Schwarze
2022-04-09 15:59   ` Abigail G
2022-04-09 18:18     ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d30674560026e12b0ac779c289e7cd862cd3869d.camel@kb6.ee \
    --to=dev@kb6.ee \
    --cc=discuss@mandoc.bsd.lv \
    --subject='Re: man.cgi doesn'\''t find symlinked manpages' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).