FS#13694 - [man-db] pages cache are not written

Attached to Project: Arch Linux
Opened by Olive (olivel) - Saturday, 07 March 2009, 17:42 GMT
Last edited by Andreas Radke (AndyRTR) - Sunday, 04 October 2009, 20:53 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Thomas Bächler (brain0)
Andreas Radke (AndyRTR)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

man should normally cache the preformatted man pages in /var/cache/man/...cat<n> in order to speed the displaying of the pages. catman can generate such a cache for all page. While catman works as expected, man never create a cache page and never access cache page created by catman (as can be seen by man -W). After doing a strace on man it appear that man look at these pages in <DIR>/cat<n> (for DIR in manpath) instead of /var/cache/man/...cat<n>. My /etc/man_db.conf is unmodified with:

MANDB_MAP /usr/man /var/cache/man/fsstnd
MANDB_MAP /usr/share/man /var/cache/man
MANDB_MAP /usr/local/man /var/cache/man/oldlocal
MANDB_MAP /usr/local/share/man /var/cache/man/local
MANDB_MAP /usr/X11R6/man /var/cache/man/X11R6
MANDB_MAP /opt/man /var/cache/man/opt

and with NOCACHE commented out

#NOCACHE

package version: man-db 2.5.4-2
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Sunday, 04 October 2009, 20:53 GMT
Reason for closing:  Won't implement
Additional comments about closing:  see comments
Comment by Alessandro Doro (adoroo) - Sunday, 08 March 2009, 14:45 GMT
You should uncomment and properly set MINCATWIDTH and MAXCATWIDTH in man_db.conf.
Anyway we have two issues:
1. /var/cache/man/ and its subdirectories permissions are 0755, owned by root:root
2. cat files are created only if $LANG = "C"; note that MANDB_MAP should be set for the localized entries, but it's not working.

btw a PIII is able to visualize the longest man pages in almost no time. Do you really need preformatted pages?
Comment by Andreas Radke (AndyRTR) - Sunday, 21 June 2009, 12:50 GMT
caching has been reworked in 2.5.5-2. please test if it is solved for you too.
Comment by Alessandro Doro (adoroo) - Sunday, 21 June 2009, 18:40 GMT
$ man -c time
man:
impossibile scrivere in /var/cache/man/cat1/time.1.gz in modo catman
time.

$ LANG=C man -c time
man: can't chmod (null): Bad address
man: can't unlink (null): Bad address
time.

$ sudo man -c time
man:
impossibile scrivere in /var/cache/man/cat1/time.1.gz in modo catman
time.

$ LANG=C sudo man -c time
time.

This time /var/cache/man/cat1/time.1.gz is written; then
$ LANG=C man -c time
time.

PS: impossibile scrivere in %s in modo catman => cannot write to %s in catman mode
Comment by Andreas Radke (AndyRTR) - Saturday, 08 August 2009, 13:42 GMT
is this issue still alive or slved with the last update?
Comment by Andreas Radke (AndyRTR) - Friday, 04 September 2009, 22:09 GMT
2.5.6 is in testing. is it solved?
Comment by Alessandro Doro (adoroo) - Monday, 07 September 2009, 13:07 GMT
Nothing changed.
I suggest to read section 7.1 (Modes of operation) of the man-db manual located in the directory "manual" of the sources (page 18 of man_db.ps created in the build process).
Comment by Colin Watson (cjwatson) - Friday, 11 September 2009, 11:35 GMT
If you want man to be able to write cat pages, you need to make both man and mandb setuid man and ensure that /var/cache/man and all its subdirectories are owned by the man user. man-db also needs to be configured with --enable-setuid.

This isn't the default because it does open some possible security risks (even though I'm very careful to try to avoid them) and because cat pages are not that enormous a performance advantage these days.
Comment by Dan McGee (toofishes) - Friday, 11 September 2009, 12:12 GMT
This isn't worth it in other ways- if widths of the pages don't scale to my current terminal size, etc. because they are cached instead, that seems annoying.

The tradeoff between security risks and speed of formatting a man page doesn't seem worth it either- we aren't in 1989 anymore, even a Pentium 100 could probably do this with reasonable speed on the fly.
Comment by Colin Watson (cjwatson) - Friday, 11 September 2009, 12:25 GMT
While I generally agree with you, FWIW man won't display cat pages if they're inappropriate due to being formatted for the wrong terminal size or other such things.
Comment by Dan McGee (toofishes) - Friday, 11 September 2009, 13:22 GMT
I guess that is a good thing thing then. However, what is the point? Am I the only one that uses terminals of all sorts of widths? My two monitors are different widths, non-X, ssh access, etc...
Comment by Andreas Radke (AndyRTR) - Sunday, 04 October 2009, 17:22 GMT
Sorry. I don't the point here.

Is allowing page caching essential because some pages otherwise wouldn't come up or is chaching only a speed improvement we can go over?

Assigning also Thomas who is on fight against setiud files.
Comment by Colin Watson (cjwatson) - Sunday, 04 October 2009, 19:54 GMT
Cat pages should work if the local system administrator configures them to work (which may include making man and mandb setuid, etc.), but they're purely a performance optimisation. The Debian packages of man-db make it an installation-time option whether those binaries are setuid, defaulting to no.

(Note that it's possible and in some cases reasonable to have cat pages in your home directory too, for manual pages you've installed in your home directory. This does not require setuidness.)
Comment by Andreas Radke (AndyRTR) - Sunday, 04 October 2009, 20:26 GMT
We don't have any user interaction in our post.install script. So we can print there "if you need cat pages and caching enabled change permission for .... to setuid", right?
Comment by Colin Watson (cjwatson) - Sunday, 04 October 2009, 20:32 GMT
Yes, or just leave it to the documentation.
Comment by Andreas Radke (AndyRTR) - Sunday, 04 October 2009, 20:52 GMT
That's probably the best. We go the Arch way and ship it with default settings. Thanks Colin for quick comments.

Loading...