summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2010-12-11 10:15:23 +0000
committerajacoutot <ajacoutot@openbsd.org>2010-12-11 10:15:23 +0000
commitbbc5ac0750ae4629d654b5cc2b538aab02f69d9a (patch)
tree810a0c8e54a69064c11659800ad051655846ad0e
parentDo not overwrite the settings in the rc scripts itself, so use the same (diff)
downloadwireguard-openbsd-bbc5ac0750ae4629d654b5cc2b538aab02f69d9a.tar.xz
wireguard-openbsd-bbc5ac0750ae4629d654b5cc2b538aab02f69d9a.zip
Sanitise daemon_flags: remove multiple whitespaces from _rcflags.
requested by okan@, ok robert@
-rw-r--r--etc/rc.d/rc.subr3
1 files changed, 2 insertions, 1 deletions
diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr
index 7819c03c36b..128559c6fda 100644
--- a/etc/rc.d/rc.subr
+++ b/etc/rc.d/rc.subr
@@ -1,4 +1,4 @@
-# $OpenBSD: rc.subr,v 1.10 2010/12/11 09:55:37 robert Exp $
+# $OpenBSD: rc.subr,v 1.11 2010/12/11 10:15:23 ajacoutot Exp $
[ -z "${local_rcconf}" ] && . /etc/rc.conf
@@ -38,6 +38,7 @@ rc_cmd() {
rc_err "$0: need root privileges"
[ -n "${daemon}" ] || rc_err "$0: daemon is not set"
[ -n "${_rcflags}" ] && daemon_flags=${_rcflags}
+ [ -n "${_rcflags}" ] && daemon_flags=`echo ${_rcflags} | tr -s "[:space:]"`
[ -n "${_rcuser}" ] && daemon_user=${_rcuser}
[ -n "${_rcclass}" ] && daemon_class=${_rcclass}
[ -n "${_rcshell}" ] && daemon_shell=${_rcshell}