summaryrefslogtreecommitdiff
path: root/etc/rc.d/rc.subr
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2019-03-21 15:10:28 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2019-03-21 15:10:28 +0000
commitd40be396d3a0352dbb0006061489ab31b10ca50a (patch)
treed409208e9d108ed3cd3a846c5f31fca1f96f6edd /etc/rc.d/rc.subr
parentff959b4ca01d51f00152a52387cad8d7677ac529 (diff)
Start in the daemon configured routing table and not in the one we're currently
in. This fixes the case where one would be in a non default rdomain shell then run an rdomain 0 rc.d daemon. reported by YASUOKA Masahiko and Pierre Emeriaud ok sthen@ claudio@ benno@
Diffstat (limited to 'etc/rc.d/rc.subr')
-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 8b414160fcf..6a8e05e3b3e 100644
--- a/etc/rc.d/rc.subr
+++ b/etc/rc.d/rc.subr
@@ -1,4 +1,4 @@
-# $OpenBSD: rc.subr,v 1.130 2019/01/20 04:52:07 ajacoutot Exp $
+# $OpenBSD: rc.subr,v 1.131 2019/03/21 15:10:27 ajacoutot Exp $
#
# Copyright (c) 2010, 2011, 2014-2017 Antoine Jacoutot <ajacoutot@openbsd.org>
# Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -320,5 +320,5 @@ unset _rcflags _rcrtable _rcuser _rctimeout
# make sure pexp matches the process (i.e. doesn't include the quotes)
pexp="$(eval echo ${daemon}${daemon_flags:+ ${daemon_flags}})"
rcexec="su -l -c ${daemon_class} -s /bin/sh ${daemon_user} -c"
-[ "${daemon_rtable}" -eq 0 ] ||
+[ "${daemon_rtable}" -eq "$(id -R)" ] ||
rcexec="route -T ${daemon_rtable} exec ${rcexec}"