Bug 142936 (IT_65243)

Summary: makewhatis can't handle a directory in a manpage directory
Product: Red Hat Enterprise Linux 3 Reporter: Pete Fritchman <petef>
Component: manAssignee: Ivana Varekova <varekova>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: cww, tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2005-326 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-28 19:51:03 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:
Bug Depends On:    
Bug Blocks: 156320    

Description Pete Fritchman 2004-12-15 03:45:27 UTC
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 15:27:05 UTC
Thank you for your notice. 
The new version is in errata process now.
Ivana Varekova

Comment 14 Red Hat Bugzilla 2005-09-28 19:51:03 UTC
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