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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=165684
@ -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