From: kn Date: Mon, 23 Sep 2024 20:54:01 +0000 (+0000) Subject: Replace `&&' with `if' for proper $? handling; OK lucas X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=957905706c6e9612b495b03b2c96863ec67583e9;p=openbsd Replace `&&' with `if' for proper $? handling; OK lucas iked and isakmpd guard against themselves with "return 0" as rc.subr(8) checks rc_pre()'s return code and aborts daemo start iff non-zero, but that isn't needed if we use ksh properly. --- diff --git a/etc/rc.d/iked b/etc/rc.d/iked index 44861ace985..005e57829d1 100644 --- a/etc/rc.d/iked +++ b/etc/rc.d/iked @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: iked,v 1.10 2022/09/04 06:57:13 ajacoutot Exp $ +# $OpenBSD: iked,v 1.11 2024/09/23 20:54:01 kn Exp $ daemon="/sbin/iked" @@ -12,10 +12,11 @@ rc_configtest() { # use rc_exec here since daemon_flags may contain arguments with spaces rc_exec "${daemon} -n ${daemon_flags}" } + rc_pre() { - [[ ${sasyncd_flags} != NO ]] && + if [[ ${sasyncd_flags} != NO ]]; then daemon_flags="-S ${daemon_flags}" - return 0 + fi } rc_cmd $1 diff --git a/etc/rc.d/isakmpd b/etc/rc.d/isakmpd index 1f554005b9c..559d0af3edd 100644 --- a/etc/rc.d/isakmpd +++ b/etc/rc.d/isakmpd @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: isakmpd,v 1.3 2018/01/11 21:09:26 rpe Exp $ +# $OpenBSD: isakmpd,v 1.4 2024/09/23 20:54:01 kn Exp $ daemon="/sbin/isakmpd" @@ -9,9 +9,9 @@ daemon="/sbin/isakmpd" pexp="isakmpd: monitor \[priv\]" rc_pre() { - [[ ${sasyncd_flags} != NO ]] && + if [[ ${sasyncd_flags} != NO ]]; then daemon_flags="-S ${daemon_flags}" - return 0 + fi } rc_cmd $1