summaryrefslogtreecommitdiff
path: root/etc/rc.d/rc.subr
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2020-07-12 14:35:39 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2020-07-12 14:35:39 +0000
commit8ccc22247dfd9360d3ef66beac1edaf6d1ef17c9 (patch)
treea87f8f0ee132576d8489b22cd1e59b943d99cc39 /etc/rc.d/rc.subr
parent5aaaccd1e18892463e55a5823101ce06e39cce20 (diff)
Use su -fl to avoid sourcing /etc/profile / the target user's .profile
This way rc.d and rcctl don't suffer from side effects in people's rc files. If you somehow used those files to set environment variables, you should have used login.conf as described in rc.d(8) instead. ok ajacoutot@
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 79a055c0967..0268e0a9722 100644
--- a/etc/rc.d/rc.subr
+++ b/etc/rc.d/rc.subr
@@ -1,4 +1,4 @@
-# $OpenBSD: rc.subr,v 1.134 2020/04/29 15:38:31 ajacoutot Exp $
+# $OpenBSD: rc.subr,v 1.135 2020/07/12 14:35:38 jca Exp $
#
# Copyright (c) 2010, 2011, 2014-2017 Antoine Jacoutot <ajacoutot@openbsd.org>
# Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -319,6 +319,6 @@ unset _rcflags _rcrtable _rctimeout _rcuser
# the shell will strip the quotes from daemon_flags when starting a daemon;
# 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"
+rcexec="su -fl -c ${daemon_class} -s /bin/sh ${daemon_user} -c"
[ "${daemon_rtable}" -eq "$(id -R)" ] ||
rcexec="route -T ${daemon_rtable} exec ${rcexec}"