From: sthen Date: Tue, 9 Nov 2021 11:29:33 +0000 (+0000) Subject: check that the rc script including rc.subr is using ksh; rc.subr uses ksh X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=328624503702a9bc280c657b92b01b342fa40208;p=openbsd 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 --- 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