On Sat, Dec 19, 2009 at 11:30:41PM -0800, Doug Barton wrote:
> Index: usr.sbin/service/service.sh
> diff -u usr.sbin/service/service.sh.orig usr.sbin/service/service.sh
> --- usr.sbin/service/service.sh.orig  2009-12-20 13:14:14.000000000 +0900
> +++ usr.sbin/service/service.sh       2009-12-20 13:17:44.420246627 +0900
> @@ -106,11 +106,15 @@
>       exit 1
>  fi
>  
> +HOME=/
> +PATH=/sbin:/bin:/usr/sbin:/usr/bin
> +export HOME PATH
> +cd $HOME
> +
>  for dir in /etc/rc.d $local_startup; do
>       if [ -x "$dir/$script" ]; then
>               [ -n "$VERBOSE" ] && echo "$script is located in $dir"
> -             $dir/$script $*
> -             exit $?
> +             exec env -i HOME=$HOME PATH=$PATH $dir/$script $*
>       fi
>  done

The $* should be changed to "$@" here, to avoid inappropriate IFS
splitting. (Even though rc.subr is broken in this way as well.)

By the way, I agree with adding this utility.

-- 
Jilles Tjoelker
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to