mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +01:00
Allow for /usr/bin/env when parsing the shebang line from an
interpreted $command. Some "portable" sofware packages use such a line to skip the task of figuring out the absolute pathname of the interpreter at install time, e.g.: #!/usr/bin/env python It is insecure, but a popular book on Python seems to have advised it to a wide audience. Hence a number of such scripts in the ports, mostly written in Python. PR: bin/100287 MFC after: 1 week
This commit is contained in:
parent
0c30639059
commit
c7be7e20f6
@ -264,6 +264,11 @@ _find_processes()
|
||||
read _interp < ${_chroot:-}/$_procname # read interpreter name
|
||||
_interp=${_interp#\#!} # strip #!
|
||||
set -- $_interp
|
||||
case $1 in
|
||||
*/bin/env)
|
||||
shift # drop env to get real name
|
||||
;;
|
||||
esac
|
||||
if [ $_interpreter != $1 ]; then
|
||||
warn "\$command_interpreter $_interpreter != $1"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user