Bug 73215 - Troubles with helper-programs invocations in 'lesspipe.sh'
Troubles with helper-programs invocations in 'lesspipe.sh'
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: less (Show other bugs)
8.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Karsten Hopp
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-08-31 17:19 EDT by Michal Jaegermann
Modified: 2007-04-18 12:46 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-16 07:48:52 EST
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 Michal Jaegermann 2002-08-31 17:19:52 EDT
Description of Problem:

/usr/bin/lesspipe.sh includes the following lines:

		if echo "$1" | grep -q ^/; then	#absolute path
			man -- "$1" | cat -s
		else
			man -- "./$1" | cat -s
		fi

That would be not so bad in itself if not that small catch that 'man -- ...'
segfaults (see #73212).  Actually, regardless of bugs in man,

		if echo "$1" | grep -q ^/; then	#absolute path
			man "$1" | cat -s
		else
			man "./$1" | cat -s
		fi

does what was clearly intended here.

This bug was not introduced in (null) but seems to have pretty long history.
OTOH this line:

  *.tar.bz2|*.tbz2) bzip2 -dc "$1" | tar tvvf - ;;

from a (null) version of lesspipe.sh could likely benefit from

  *.tar.bz2|*.tbz2) bzip2 -dc -- "$1" | tar tvvf - ;;

or, alternatively, one can do
echo "$1" | grep -q ^/ && data="$1" || data="./$1"
at the very beginning of lesspipe() function and use "$data" instead of "$1"
consistently all over the place.  Then '--', and possible troubles caused by
it, will be not needed.
Comment 1 Karsten Hopp 2002-09-03 09:22:40 EDT
The real bug was in man and has been fixed.
Comment 2 Michal Jaegermann 2002-09-03 12:33:09 EDT
Ahem!  The report was somewhat more general that one specific bug in 'man'
which forced a closer examination of that script.

In particular you should decide if you really want '--' with 'bzip2 -dc'
because now you have two variants in two separate occurences.  Note that
the proposed modification arguments would be always valid reagardles if
'--' was used, and accepted or not, by a particular utility.

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