Bug 43318 - apropos and whatis broken by update to man-1.5i-4
apropos and whatis broken by update to man-1.5i-4
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: man (Show other bugs)
7.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-06-02 22:38 EDT by Need Real Name
Modified: 2007-04-18 12:33 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-07-23 06:45:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2001-06-02 22:38:33 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.2.19-7.0.1 i686)

Description of problem:
Per Redhard Security Advisory RHSA-2001:069-02, I installed the man-1.5i-4
update.  It caused the apropos and whatis commands to stop working
properly.  They stopped listing anything unless at least one hit was found
in
/var/cache/man or /usr/lib, but _excluding_  hits that should have been
found in $manpath.

Scripts /usr/bin/whatis and /usr/bin/apropos are almost identical and were
both broken by this update on the line 71.
In the previous man package (man-1.5h1), line 71 was:
    for d in $manpath /usr/lib

In man-1.5i-4 (and also in Rawhide man-1.5i-6), the intent was to add
/var/cache/man, but in doing so $manpath was inadvertently dropped, leaving
line 71 as:
    for d in /var/cache/man /usr/lib 

The correct line 71 should be:
    for d in /var/cache/man $manpath /usr/lib

How reproducible:
Always

Steps to Reproduce:
1.  Verify that man page xmbind is not in /var/cache/man.
2.   Execute command: apropos xmbind

Actual Results:  Nothing is listed

Expected Results:  A line should have been shown for the xmbind man page.
Comment 1 Need Real Name 2001-06-07 14:54:52 EDT
Looks to me like apropos and whatis are fine, but makewhatis is broken both in
the man-1.5i-4 rpm and the man-1.5i-8 off rawhide. Here's the output of
makewhatis -w -v:

about to enter /usr/local/man
adding ./java.1
adding ./keytool.1
adding ./rmid.1
adding ./rmiregistry.1
adding ./tnameserv.1
about to enter /usr/share/man
skipping /usr/share/man - we did it already
about to enter /usr/kerberos/man
skipping /usr/kerberos/man - we did it already
about to enter /usr/X11R6/man
skipping /usr/X11R6/man - we did it already
about to enter /usr/lib/perl5/man
skipping /usr/lib/perl5/man - we did it already
about to enter /usr/man
skipping /usr/man - we did it already
about to enter /usr/local/man
about to enter /usr/share/man
about to enter /usr/kerberos/man
about to enter /usr/X11R6/man
about to enter /usr/lib/perl5/man
about to enter /usr/man

Everything after the first directory in the manpath is skipped. It looks like
the offending line in makewhatis is 146:

     if [ -s /var/cache/man/whatis -a $pages = man -a x$update = x ]; then

After the first entry in manpath is evaluated, this will always return true and
the other entries are skipped.

This line was formally:

     if [ -s ${mandir}/whatis -a $pages = man -a x$update = x ]; then

This is intended to detect if a given man dir needs to be updated in the whatis
table, but with the move to /var/cache/man/whatis breaks things badly.

I don't see an easy fix for this. There is not a good way to detect if a given
man directory needs to be updated in the whatis database with a single database
file.

IMHO, The whole idea of a single whatis database in /var/cache/man/whatis is a
bad one. It not only causes problems with knowing what to update, but I can no
longer set the default man path on a system to exclude man directories that I
don't want the average user to see. In fact I would like to see an sman
directory where the man pages for stuff from sbin would go. I don't see any
reason for the average user to see the man pages for things they shouldn't be
running anyway.

Comment 2 Need Real Name 2001-06-07 21:45:32 EDT
Oops.  Yes.  I retract my statements about whatis and apropos.  I didn't look
into things deeply
 enough to realize one would have to do a fresh makewhatis run because of the
new whatis
 caching.   Please consider _my_ bug report closed.  I won't mark the this
report itself as 
closed myself (leaving that to the judgement of Redhat) because of the
subsequent comments by  benj@visi.com, which effectively turn this into a
different bug report.
Comment 3 Helge Deller 2001-06-11 08:47:00 EDT
seems to be fixed with the next to-be released errata.
Comment 4 Bernhard Rosenkraenzer 2001-09-21 16:39:43 EDT
Fixed in 1.5i2-*

Note You need to log in before you can comment on or make changes to this bug.