Browse Source

unset _rcflags and _rcuser so that they don't get inherited by rc.d(8)

scripts; from robert at peichaer dot org
ok halex@
While here, put the "sanitation" commands in their own block.
OPENBSD_5_3
ajacoutot 12 years ago
parent
commit
ccfdfa3ecd
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      src/etc/rc.d/rc.subr

+ 5
- 2
src/etc/rc.d/rc.subr View File

@ -1,4 +1,4 @@
# $OpenBSD: rc.subr,v 1.61 2012/08/13 08:08:00 ajacoutot Exp $
# $OpenBSD: rc.subr,v 1.62 2012/08/13 10:10:07 ajacoutot Exp $
#
# Copyright (c) 2010, 2011 Antoine Jacoutot <ajacoutot@openbsd.org>
# Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@ -203,8 +203,11 @@ getcap -f /etc/login.conf ${_name} 1>/dev/null 2>&1 && \
[ -n "${_rcflags}" ] && daemon_flags=${_rcflags}
[ -n "${_rcuser}" ] && daemon_user=${_rcuser}
# sanitize
daemon_flags=$(printf ' %s' ${daemon_flags})
daemon_flags=${daemon_flags## }
readonly daemon_class
unset _rcflags _rcuser
pexp="${daemon}${daemon_flags:+ ${daemon_flags}}"
rcexec="su -l -c ${daemon_class} -s /bin/sh ${daemon_user} -c"
readonly daemon_class

Loading…
Cancel
Save