diff options
author | yar <yar@FreeBSD.org> | 2006-12-31 11:07:29 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2006-12-31 11:07:29 +0000 |
commit | 0a888a1e57471d297912bd8c53a32917b18097c9 (patch) | |
tree | e1c28f84a3c68eb062bbdc70669b27c4bf4a72f0 /etc | |
parent | dc9f8423c3772111565181a8568c60c4da0a1689 (diff) | |
download | FreeBSD-src-0a888a1e57471d297912bd8c53a32917b18097c9.zip FreeBSD-src-0a888a1e57471d297912bd8c53a32917b18097c9.tar.gz |
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
Diffstat (limited to 'etc')
-rw-r--r-- | etc/rc.subr | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/etc/rc.subr b/etc/rc.subr index a33c07f..e938cbc 100644 --- a/etc/rc.subr +++ b/etc/rc.subr @@ -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 |