From 5aff56ad607a4905cc95cbf2c367aeaa662acc8f Mon Sep 17 00:00:00 2001 From: Stuart Henderson Date: Tue, 9 Nov 2021 11:29:34 +0000 Subject: check that the rc script including rc.subr is using ksh; rc.subr uses ksh features and scripts will not work correctly with sh. tweak jca/ok kn/ ok with direction aja --- etc/rc.d/rc.subr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'etc/rc.d') diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr index 4cefd27cb79..dfdd9229342 100644 --- a/etc/rc.d/rc.subr +++ b/etc/rc.d/rc.subr @@ -1,4 +1,4 @@ -# $OpenBSD: rc.subr,v 1.143 2021/11/08 10:10:50 ajacoutot Exp $ +# $OpenBSD: rc.subr,v 1.144 2021/11/09 11:29:33 sthen Exp $ # # Copyright (c) 2010, 2011, 2014-2021 Antoine Jacoutot # Copyright (c) 2010, 2011 Ingo Schwarze @@ -285,6 +285,7 @@ rc_cmd() { _name=${0##*/} _rc_check_name "${_name}" || _rc_err "invalid rc.d script name: ${_name}" +[ -n "${KSH_VERSION}" ] || _rc_err "$0: wrong shell, use /bin/ksh" [ -n "${daemon}" ] || _rc_err "$0: daemon is not set" unset _RC_DEBUG _RC_FORCE -- cgit v1.2.3