[#] http://marc.info/?l=openbsd-cvs&m=140778639525544&w=2
openbsd-cvs(obsdave,2) — All
2014-08-11 23:55:13


> CVSROOT: /cvs
> Module name: src
> Changes by: ajacoutot@cvs.openbsd.org 2014/08/11 07:25:23
>
> Modified files:
> etc/rc.d : rc.subr
>
> Log message:
> Make it possible to pass arguments to _rc_parse_conf().
>
> ok robert@

This badly breaks /etc/rc and /etc/netstart, which both use
_rc_parse_conf without parameters. Instead of wiring the default
parameters (/etc/rc.conf and /etc/rc.conf.local) there, too, I think
it's better to let _rc_parse_conf use them as defaults when it has
been invoked without parameters. Also, there's no reason to use
' ... in "$@"' in a for loop.

ok?

Index: rc.subr
===================================================================
RCS file: /cvs/src/etc/rc.d/rc.subr,v
retrieving revision 1.78
diff -u -p -r1.78 rc.subr
--- rc.subr 11 Aug 2014 13:25:23 -0000 1.78
+++ rc.subr 11 Aug 2014 19:22:36 -0000
@@ -121,7 +121,8 @@ _rc_parse_conf() {
pf_rules ipsec_rules shlib_dirs pkg_scripts \
nfs_server

- for _rcfile in $@; do
+ [ $# -gt 0 ] || set -- /etc/rc.conf /etc.rc.conf.local
+ for _rcfile; do
[[ -f $_rcfile ]] || continue
while IFS=' ' read -r _l; do
[[ $_l == [!#=]*=* ]] || continue
@@ -263,7 +264,7 @@ _RC_RUNDIR=/var/run/rc.d
_RC_RUNFILE=${_RC_RUNDIR}/${_name}

# parse /etc/rc.conf{.local} for the daemon_flags
-_rc_do _rc_parse_conf /etc/rc.conf /etc/rc.conf.local
+_rc_do _rc_parse_conf

eval _rcflags=\${${_name}_flags}
eval _rcuser=\${${_name}_user}