Bug 43318

Summary: apropos and whatis broken by update to man-1.5i-4
Product: [Retired] Red Hat Linux Reporter: Need Real Name <dale+bz>
Component: manAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED ERRATA QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: benj
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-07-23 10:45:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2001-06-03 02:38:33 UTC
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 18:54:52 UTC
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-08 01:45:32 UTC
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, which effectively turn this into a
different bug report.

Comment 3 Helge Deller 2001-06-11 12:47:00 UTC
seems to be fixed with the next to-be released errata.


Comment 4 Bernhard Rosenkraenzer 2001-09-21 20:39:43 UTC
Fixed in 1.5i2-*