discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Alexis <flexibeast@gmail.com>
Cc: discuss@mandoc.bsd.lv, groff@gnu.org, man-db-devel@nongnu.org
Subject: Re: Behaviour of .so differs between mandoc and groff
Date: Sun, 30 Apr 2023 09:24:42 +1000	[thread overview]
Message-ID: <87edo2z2x3.fsf@ada> (raw)
In-Reply-To: <87ildo5xlr.fsf@ada>


Ping. Does anyone have any thoughts on this? It's a small but 
persistent irritation on my system. :-)

Alexis <flexibeast@gmail.com> writes:

> [1. text/plain]
>
> Hi all,
>
> On my Gentoo system, awk.1 simply contains an .so request whose
> argument is the man page for the actual awk implementation in 
> use,
> i.e. just:
>
>    .so gawk.1
>
> However, although this works when using man-db, it doesn't when 
> one is
> using mandoc instead, as on my system. Instead of gawk.1 being
> sourced, processed and displayed, i get output along the lines 
> of:
>
>    ()                                    ()
>            See the file gawk.1.
>
>
>    ()
>
> However, if i change the request in awk.1 to:
>
>    .so man1/gawk.1
>
> then everything works as expected.
>
> The example in the entry for .so in mandoc_roff(7) is what led 
> me to
> try the preceding, but there's no further indication that the
> requirement for a leading section directory is consciously 
> different
> from any other roff implementation, or from groff in 
> particular. A
> comment in roff_so() in mandoc/roff.c[a] says:
>
>    /*
>    /* Handle `so'.  Be EXTREMELY careful, as we shouldn't be
>     * opening anything that's not in our cwd or anything beneath
>     * it.  Thus, explicitly disallow traversing up the
>       file-system
>     * or using absolute paths.
>     */
>
> i couldn't find any discussion about .so in the mandoc TODO 
> list[b].
>
> i've no idea what the 'correct' behaviour 'should' be, from 
> whatever
> perspective (historical / security / groff-compatibility / 
> etc.), so
> am cross-posting to what i believe to be the relevant lists.
>
>
> Alexis.
>
> [a]
> https://cvsweb.bsd.lv/mandoc/roff.c?rev=1.395&content-type=text/x-cvsweb-markup
>
> [b]
> https://cvsweb.bsd.lv/mandoc/TODO?rev=1.327&content-type=text/x-cvsweb-markup

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


  reply	other threads:[~2023-04-29 23:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-22  4:21 Alexis
2023-04-29 23:24 ` Alexis [this message]
     [not found]   ` <20230430120555.3mydcm7qmbsf75v6@illithid>
2023-05-03  0:27     ` Alexis
2023-05-04  5:44     ` Alexis
2023-05-04  6:18       ` Jan Stary
2023-05-04  7:13         ` Alexis

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=87edo2z2x3.fsf@ada \
    --to=flexibeast@gmail.com \
    --cc=discuss@mandoc.bsd.lv \
    --cc=groff@gnu.org \
    --cc=man-db-devel@nongnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).