Bug 79289 - man -k attempts to run 'unsafe' script
man -k attempts to run 'unsafe' script
Product: Red Hat Linux
Classification: Retired
Component: man (Show other bugs)
All Linux
high Severity medium
: ---
: ---
Assigned To: Eido Inoue
Ben Levenson
: Security
Depends On:
  Show dependency treegraph
Reported: 2002-12-09 11:54 EST by David Wijnants
Modified: 2007-03-26 23:58 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-01-06 17:19:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description David Wijnants 2002-12-09 11:54:14 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.79 [en] (X11; U; Linux 2.4.18-18.7.x i686)

Description of problem:
If the parameter passed to 'man -k' contains a space, it exits with 'sh: unsafe:
command not found'. If there is a script with that name on the path, the script
will be run.

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

How reproducible:

Steps to Reproduce:
1. man -k 'what is'
2. Now the same with example script (unsafe) on the path

echo "You've been trojaned!"

Actual Results:  Without 'unsafe' on path:

sh: unsafe: command not found
Error executing formatting or display command.
System command unsafe exited with status 32512.

With 'unsafe' on path:

You've been trojaned!

Expected Results:

what: nothing appropriate
is: nothing appropriate

(cf. apropos)

Additional info:

man-1.5j/src/utils.c filters out 'non-shell-safe commands' by replacing them
with the string 'unsafe', but man still goes ahead and runs the 'unsafe'
Comment 1 Alan Cox 2002-12-18 13:44:54 EST
Agreed. We don't have "." on the path so the damage is minimal but its a bug
that wants squashing
Comment 2 Eido Inoue 2003-01-06 17:19:58 EST
fixed in man-1.5j-14
Comment 3 Mark J. Cox 2003-04-28 08:45:56 EDT
An errata 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.


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