Bug 25324

Summary: lesspipe.sh does the wrong thing for *.[1-9].{gz,bz2}
Product: [Retired] Red Hat Linux Reporter: Bradley <bbaetz>
Component: lessAssignee: Karsten Hopp <karsten>
Status: CLOSED RAWHIDE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: phr
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-31 21:57:20 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 Bradley 2001-01-30 19:48:09 UTC
lesspipe.sh has some special matches to handle compressed man pages, and
checks after decompression that these are man pages. It doesn't have
backups incase it was just a normal file with a name which matched (eg less
patch-2.4.1.bz2 just displays the compressed input)

To fix, change the first two cases to be:

  *.1.gz|*.2.gz|*.3.gz|*.4.gz|*.5.gz|*.7.gz|*.8.gz|*.9.gz|*.n.gz|*.man.gz)
    if gunzip -c "$1" |file - |grep troff &>/dev/null; then
      gunzip -c "$1" |groff -s -p -t -e -Tlatin1 -mandoc - ;
    else
      gzip -dc "$1"  2>/dev/null ;
    fi ;;
 
*.1.bz2|*.2.bz2|*.3.bz2|*.4.bz2|*.5.bz2|*.7.bz2|*.8.bz2|*.9.bz2|*.n.bz2|*.man.bz2
    if bunzip2 -c "$1" |file - |grep troff &>/dev/null; then
      bunzip2 -c "$1" |groff -s -p -t -e -Tlatin1 -mandoc -
    else
      bzip2 -dc "$1"  2>/dev/null ;
    fi ;;

Comment 1 Philip Rowlands 2001-01-31 21:57:15 UTC
The current lesspipe.sh in rawhide is a significant rewrite of the less-358-7
version shipped with RH7.0. However, it exhibits the same bug as reported, in
not handling non-manpage files with manpage-like names.

See bug #17456 for a fix.

Comment 2 Karsten Hopp 2001-01-31 22:46:09 UTC
Thanks for this bugreport and the fix.
less-358-13 contains a fix for this