[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Behaviour of .so differs between mandoc and groff
From: |
Alexis |
Subject: |
Behaviour of .so differs between mandoc and groff |
Date: |
Sat, 22 Apr 2023 14:21:11 +1000 |
User-agent: |
mu4e 1.8.14; emacs 28.3 |
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
- Behaviour of .so differs between mandoc and groff,
Alexis <=