Bug 142936 - (IT_65243) makewhatis can't handle a directory in a manpage directory
makewhatis can't handle a directory in a manpage directory
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: man (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ivana Varekova
Ben Levenson
:
Depends On:
Blocks: 156320
  Show dependency treegraph
 
Reported: 2004-12-14 22:45 EST by Pete Fritchman
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2005-326
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-28 15:51:03 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 Pete Fritchman 2004-12-14 22:45:27 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; rv:1.7.3)
Gecko/20040913 Firefox/0.10

Description of problem:
The readline() function in the awk in makewhatis calls "getline" on
every file it tries to parse (awk's input).  makewhatis feeds awk like
this:
find . -name '*' $findarg -print | $AWK ...
This could include a directory (we have an "OLD" directory in
/usr/local/man/man* because our local install(1) binary creates it as
a backout path; there could be a directory here for any reason,
though).  getline in awk throws an error on a directory.  There's no
point in feeding awk directories (or anything other than files) if we
know it won't be able to handle them.  I propose:
find . -name '*' $findarg \! -type d -print | $AWK ...
I can't decide if "-maxdepth 1" should also be added to exclude files
in subdirectories -- we want to exclude them in this specific case
(OLD backout files), but I'm not sure if there's ever a legitimate
case where you want to look at man files in subdirs.

Version-Release number of selected component (if applicable):
man-1.5k-10

How reproducible:
Always

Steps to Reproduce:
1. mkdir /usr/local/man/man1/OLD
2. makewhatis -w

    

Actual Results:  awk: cmd. line:10: (FILENAME=- FNR=1) fatal: file
`./OLD' is a directory


Expected Results:  We should not have fed a directory to awk that uses
"getline" which only works on a file.

Additional info:
Comment 5 Ivana Varekova 2005-03-17 10:27:05 EST
Thank you for your notice. 
The new version is in errata process now.
Ivana Varekova
Comment 14 Red Hat Bugzilla 2005-09-28 15:51:03 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2005-326.html

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