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

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