aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/configure
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2020-01-26 21:25:41 +0000
committerIngo Schwarze <schwarze@openbsd.org>2020-01-26 21:25:41 +0000
commit5cf1df732d93997f3e216c27332ceb45638b8f43 (patch)
treea65c367cc0011ff3e536ab896d004dab58fb66c5 /configure
parent867533b50023abd39552f7026484f3335f165db8 (diff)
downloadmandoc-5cf1df732d93997f3e216c27332ceb45638b8f43.tar.gz
mandoc-5cf1df732d93997f3e216c27332ceb45638b8f43.tar.zst
mandoc-5cf1df732d93997f3e216c27332ceb45638b8f43.zip
Repair more of the issues that i found in filescan() while investigating
the report from <Andreas dot Kahari at abc dot se> on ports@: For a symlink, use the first of the following names that is available: 1. In -t mode, the symlink itself (unchanged). 2. When the (unresolved) symlink already resides inside the manpath, just strip the manpath and use the rest (unchanged). 3. When prefix(es) of the unresolved symlink point to the manpath, strip the longest such prefix and use the rest (new); this fixes situations where the manpath or one of its parent directories is a symlink and at the same time contains symlinks to manual pages. 4. Fall back to the fully resolved symlink, with the manpath stripped (new); this may for example happen when the command line passes symlinks from outside the manpath that point to manual pages inside the manpath, or if manual page trees contain symlinks to symlinks and not all of them are given on the command line. The fallback (4) isn't perfect. You can construct symlink spaghetti in such a way that this algorithm will not enter all manual page names into the database that a human would be able to deduce. But i do not expect such spaghetti to actually occur in practice (not even in ports), and a full fix would require re-implementing realpath(3) in terms of step-by-step readlink(2) calls, repeating the complicated algorithm (3) after each step. While here, also stop using PATH_MAX as the size of a static buffer in filescan(); on some systems, it can be unreasonably large. Instead, allocate path strings dynamically.
Diffstat (limited to 'configure')
0 files changed, 0 insertions, 0 deletions