summaryrefslogtreecommitdiff
path: root/etc/rc.d
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2011-04-06 06:09:29 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2011-04-06 06:09:29 +0000
commit9bd7077cf7cfa9434964ccfab2e2c37e8afa31c4 (patch)
treeb4d57659c8c2ab0d23f8b458668b170760d147ca /etc/rc.d
parenteb4b46d439e370c3d9db4d5dba7815b11a875356 (diff)
Remove leading/trailing spaces from daemon_flags.
ok schwarze@
Diffstat (limited to 'etc/rc.d')
-rw-r--r--etc/rc.d/rc.subr4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr
index 0110e0a9fb0..386c97871ec 100644
--- a/etc/rc.d/rc.subr
+++ b/etc/rc.d/rc.subr
@@ -1,4 +1,4 @@
-# $OpenBSD: rc.subr,v 1.32 2011/04/05 13:57:57 guenther Exp $
+# $OpenBSD: rc.subr,v 1.33 2011/04/06 06:09:28 ajacoutot Exp $
# Default functions and variables used by rc.d(8) scripts.
@@ -116,6 +116,6 @@ getcap -f /etc/login.conf ${_name} 1>/dev/null 2>&1 && \
[ -n "${_rcflags}" ] && daemon_flags=${_rcflags}
[ -n "${_rcuser}" ] && daemon_user=${_rcuser}
-daemon_flags=$(printf '%s\n' "${daemon_flags}" | tr -s "[:space:]")
+daemon_flags=$(printf '%s\n' "${daemon_flags}" | tr -s "[:space:]" | sed 's/^[ \t]*//;s/[ \t]*$//')
pexp="${daemon}${daemon_flags:+ ${daemon_flags}}"
rcexec="su -l -c ${daemon_class} -s /bin/sh ${daemon_user} -c"