summaryrefslogtreecommitdiffstats
path: root/etc/rc.subr
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2006-12-31 11:07:29 +0000
committeryar <yar@FreeBSD.org>2006-12-31 11:07:29 +0000
commit0a888a1e57471d297912bd8c53a32917b18097c9 (patch)
treee1c28f84a3c68eb062bbdc70669b27c4bf4a72f0 /etc/rc.subr
parentdc9f8423c3772111565181a8568c60c4da0a1689 (diff)
downloadFreeBSD-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/rc.subr')
-rw-r--r--etc/rc.subr5
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
OpenPOWER on IntegriCloud