D9033: man ioslave: asserts trying to display pam(8)

Jonathan Marten noreply at phabricator.kde.org
Tue Nov 28 13:00:58 UTC 2017


marten created this revision.
marten added a reviewer: Plasma.
Restricted Application added a project: Plasma.
Restricted Application added a subscriber: plasma-devel.

REVISION SUMMARY
  That page, and many others, links to another page with just a plain name:
  
    .so PAM.8
  
  This is read by man2html and passed to MANProtocol::readManPage() with a filename of "../PAM.8".  This is then resolved against the containing directory "/usr/share/man/man8", becoming "/usr/share/man/PAM.8".  No such file exists and the mandir.entryList().first() asserts because the list is empty.
  
  The relative filename is correct in the case of other pages. e.g. telinit(8) which uses:
  
    .so man8/init.8
  
  So it is not enough to simply ignore the "..".  The change to man2html here attempts to correct the reference by detecting whether it is of the form "../page.sect" and is not "../manN/page.sect", and removing the ".." component only in the first case.
  
  While investigating this I found it useful to have a better diagnostic if the .so page could not be found.  The change here to kio_man.cpp detects that case and displays an error page instead of asserting.  This should only happen if there is a bug in the man page, but it is useful to have a pointer so that the upstream man page can be fixed.

TEST PLAN
  Built kio_extras with this change.  Verified correct display of the man pages:
  
    man:/pam(8) - simple page name
    man:/service(8)
    man:/telinit(8) - relative page name with section
    man:/vigr(8)
    man:/mq_open(2) - relative page name to another section

REPOSITORY
  R320 KIO Extras

REVISION DETAIL
  https://phabricator.kde.org/D9033

AFFECTED FILES
  man/kio_man.cpp
  man/man2html.cpp

To: marten, #plasma
Cc: plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20171128/503c24a2/attachment.html>


More information about the Plasma-devel mailing list