Bug 144053

Summary: man doesn't work if noclobber is set
Product: [Fedora] Fedora Reporter: Paramjit Oberoi <p_s_oberoi>
Component: groffAssignee: Jindrich Novy <jnovy>
Status: CLOSED DUPLICATE QA Contact: Mike McLean <mikem>
Severity: high Docs Contact:
Priority: medium    
Version: 4CC: buysse, pknirsch
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: 2005-04-28 12:38:55 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:
Attachments:
Description Flags
adds set +o noclobber to script none

Description Paramjit Oberoi 2005-01-04 05:20:41 UTC
Description of problem:
man uses /usr/bin/nroff to render man pages.  nroff creates a temporary file, and then 
redirects some output to that file (/usr/bin/nroff, line 50).  The redicretion fails if the 
"noclobber" option is set.  This leads to the pager displaying an empty document.

Version-Release number of selected component (if applicable):
groff-1.18.1.1-3

How reproducible:
Type the following commands in a bash shell:

    $ echo "set -o noclobber" > zzz
    $ BASH_ENV="`pwd`/zzz" man man

  
Actual results:
less will display an empty file.  No errors are reported.

Expected results:
less displays the man page.

Additional info:
Proposed fix: change the offending line as follows:

old: cat ${1+"$@"} > ${TMPFILE}
new: cat ${1+"$@"} >| ${TMPFILE}

The >| operator forces redirection even if noclobber is set.

Comment 1 Joshua Buysse 2005-03-07 23:00:26 UTC
Created attachment 111761 [details]
adds set +o noclobber to script

This is an alternate patch, quick and dirty.  Alternately could be done as the
original submitter proposed.

Comment 2 Jindrich Novy 2005-04-28 12:38:55 UTC
Yes, the change from > to >| seems to be as the simplest solution to this issue.
Thanks for the patch anyway.

*** This bug has been marked as a duplicate of 127492 ***