Bug 43318 - apropos and whatis broken by update to man-1.5i-4
Summary: apropos and whatis broken by update to man-1.5i-4
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: man   
(Show other bugs)
Version: 7.0
Hardware: All Linux
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: Aaron Brown
Depends On:
TreeView+ depends on / blocked
Reported: 2001-06-03 02:38 UTC by Need Real Name
Modified: 2007-04-18 16:33 UTC (History)
1 user (show)

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

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2001:072 high SHIPPED_LIVE : Updated man package fixing GID security problems. 2001-05-28 04:00:00 UTC

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
/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:

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

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@visi.com, 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-*

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