From 7386be517bd3bd6bd9d9f20d652d310573d23c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= Date: Tue, 5 Nov 2024 16:53:58 +0100 Subject: [PATCH] Add support for multiple values in sysctlval parameter --- shared/templates/sysctl/sce-bash.template | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shared/templates/sysctl/sce-bash.template b/shared/templates/sysctl/sce-bash.template index ba8e4f683a9..7435a7f67a9 100644 --- a/shared/templates/sysctl/sce-bash.template +++ b/shared/templates/sysctl/sce-bash.template @@ -75,6 +75,7 @@ if [[ $? == 0 ]] ; then fi {{% endif %}} +{{% if SYSCTLVAL is string %}} {{% if SYSCTLVAL == "" -%}} expected_value="$XCCDF_VALUE_sysctl_{{{ SYSCTLID }}}_value" {{%- else -%}} @@ -84,4 +85,12 @@ check_sysctl_configuration "{{{ SYSCTLVAR }}}" "$expected_value" if [[ $? == 0 ]] ; then exit $XCCDF_RESULT_PASS fi +{{% elif SYSCTLVAL is sequence %}} +{{% for x in SYSCTLVAL %}} +check_sysctl_configuration "{{{ SYSCTLVAR }}}" "{{{ x }}}" +if [[ $? == 0 ]] ; then + exit $XCCDF_RESULT_PASS +fi +{{% endfor %}} +{{% endif %}} exit $XCCDF_RESULT_FAIL