Red Hat Bugzilla – Bug 79289
man -k attempts to run 'unsafe' script
Last modified: 2007-03-26 23:58:55 EDT
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):
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!
what: nothing appropriate
is: nothing appropriate
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'
Agreed. We don't have "." on the path so the damage is minimal but its a bug
that wants squashing
fixed in man-1.5j-14
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.