Blame SOURCES/scap-security-guide-0.1.62-sysctl-restrict_symlink_test_to_oval_5_10-PR_8721.patch

f89c37
From 484ceb5641f53a8f3b505099a3bebb8d5e481f1a Mon Sep 17 00:00:00 2001
f89c37
From: Watson Sato <wsato@redhat.com>
f89c37
Date: Fri, 6 May 2022 11:31:31 +0200
f89c37
Subject: [PATCH] Restrict the symlink test to OVAL 5.11
f89c37
f89c37
The symlink_test was added in OVAL 5.11 and is not availble in 5.10.
f89c37
The 5.10 version of the sysctl template will not check for sysctl
f89c37
options defined in more than on file.
f89c37
---
f89c37
 shared/templates/sysctl/oval.template | 4 ++++
f89c37
 1 file changed, 4 insertions(+)
f89c37
f89c37
diff --git a/shared/templates/sysctl/oval.template b/shared/templates/sysctl/oval.template
f89c37
index ba4e65cbaef..53456a90a01 100644
f89c37
--- a/shared/templates/sysctl/oval.template
f89c37
+++ b/shared/templates/sysctl/oval.template
f89c37
@@ -114,7 +114,9 @@
f89c37
         
f89c37
                    test_ref="test_static_usr_lib_sysctld_{{{ SYSCTLID }}}"/>
f89c37
       </criteria>
f89c37
+{{% if target_oval_version >= [5, 11] %}}
f89c37
       <criterion comment="Check that {{{ SYSCTLID }}} is defined in only one file" test_ref="test_sysctl_{{{ SYSCTLID }}}_defined_in_one_file" />
f89c37
+{{% endif %}}
f89c37
     </criteria>
f89c37
   </definition>
f89c37
 
f89c37
@@ -140,6 +142,7 @@
f89c37
     {{{ state_static_sysctld("usr_lib_sysctld") }}}
f89c37
   </ind:textfilecontent54_test>
f89c37
 
f89c37
+{{% if target_oval_version >= [5, 11] %}}
f89c37
   
f89c37
   id="test_sysctl_{{{ SYSCTLID }}}_defined_in_one_file" version="1">
f89c37
     <ind:object object_ref="oject_sysctl_{{{ SYSCTLID }}}_defined_in_one_file" />
f89c37
@@ -214,6 +217,7 @@
f89c37
   <unix:symlink_object comment="syctl symlinks" id="object_{{{ SYSCTLID }}}_symlinks" version="1">
f89c37
     <unix:filepath operation="equals" var_ref="local_var_conf_files_{{{ SYSCTLID }}}" />
f89c37
   </unix:symlink_object>
f89c37
+{{% endif %}}
f89c37
 
f89c37
   <local_variable comment="List of conf files" datatype="string" id="local_var_conf_files_{{{ SYSCTLID }}}" version="1">
f89c37
     <object_component object_ref="object_static_set_unfiltered_sysctls_{{{ SYSCTLID }}}" item_field="filepath" />