summaryrefslogtreecommitdiffstats
path: root/recipes-compliance/openscap/files/0002-openembedded-add-Poky-distro.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-compliance/openscap/files/0002-openembedded-add-Poky-distro.patch')
-rw-r--r--recipes-compliance/openscap/files/0002-openembedded-add-Poky-distro.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/recipes-compliance/openscap/files/0002-openembedded-add-Poky-distro.patch b/recipes-compliance/openscap/files/0002-openembedded-add-Poky-distro.patch
new file mode 100644
index 0000000..182d9ec
--- /dev/null
+++ b/recipes-compliance/openscap/files/0002-openembedded-add-Poky-distro.patch
@@ -0,0 +1,80 @@
1From eb3865f2603fff2cc5d39d2379ba9f3857affca9 Mon Sep 17 00:00:00 2001
2From: Armin Kuster <akuster@mvista.com>
3Date: Sun, 4 Jun 2023 20:51:50 -0400
4Subject: [PATCH 2/2] openembedded: add Poky distro
5
6Signed-off-by: Armin Kuster <akuster@mvista.com>
7---
8 cpe/openscap-cpe-dict.xml | 4 ++++
9 cpe/openscap-cpe-oval.xml | 14 ++++++++++++++
10 src/OVAL/probes/unix/runlevel_probe.c | 8 +++++++-
11 3 files changed, 25 insertions(+), 1 deletion(-)
12
13diff --git a/cpe/openscap-cpe-dict.xml b/cpe/openscap-cpe-dict.xml
14index 3338a9e55..f86b55864 100644
15--- a/cpe/openscap-cpe-dict.xml
16+++ b/cpe/openscap-cpe-dict.xml
17@@ -57,5 +57,9 @@
18 <title xml:lang="en-us">OpenEmbedded all versions</title>
19 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5" href="openscap-cpe-oval.xml">oval:org.open-scap.cpe.openembedded:def:1</check>
20 </cpe-item>
21+ <cpe-item name="cpe:/o:openembedded:poky">
22+ <title xml:lang="en-us">Poky all versions</title>
23+ <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5" href="openscap-cpe-oval.xml">oval:org.open-scap.cpe.poky:def:1</check>
24+ </cpe-item>
25
26 </cpe-list>
27diff --git a/cpe/openscap-cpe-oval.xml b/cpe/openscap-cpe-oval.xml
28index 2f3e25419..03d192333 100644
29--- a/cpe/openscap-cpe-oval.xml
30+++ b/cpe/openscap-cpe-oval.xml
31@@ -835,6 +835,20 @@
32 <criterion comment="OpenEmbedded is installed." test_ref="oval:org.open-scap.cpe.openembedded:tst:1" />
33 </criteria>
34 </definition>
35+ <definition class="inventory" id="oval:org.open-scap.cpe.poky:def:1" version="1" >
36+ <metadata>
37+ <title>Yocto Project Reference Distro</title>
38+ <affected family="unix">
39+ <platform>Poky Distro</platform>
40+ </affected>
41+ <reference ref_id="cpe:/o:openembedded:poky" source="CPE"/>
42+ <description>Yocto Project Reference Distro is installed</description>
43+ </metadata>
44+ <criteria>
45+ <criterion comment="Installed operating system is part of the unix family." test_ref="oval:org.open-scap.cpe.poky:tst:1" />
46+ <criterion comment="Yocto Project Reference Distro is installed." test_ref="oval:org.open-scap.cpe.poky:tst:1" />
47+ </criteria>
48+ </definition>
49 </definitions>
50 <tests>
51 <rpmverifyfile_test check_existence="at_least_one_exists" id="oval:org.open-scap.cpe.rhel:tst:2" version="1" check="at least one" comment="/etc/redhat-release is provided by redhat-release package"
52diff --git a/src/OVAL/probes/unix/runlevel_probe.c b/src/OVAL/probes/unix/runlevel_probe.c
53index 00a5b85f6..ae6fc0c19 100644
54--- a/src/OVAL/probes/unix/runlevel_probe.c
55+++ b/src/OVAL/probes/unix/runlevel_probe.c
56@@ -408,6 +408,11 @@ static int is_openembedded(void)
57 return parse_os_release("cpe:/o:openembedded:nodistro");
58 }
59
60+static int is_poky(void)
61+{
62+ return parse_os_release("cpe:/o:openembedded:poky");
63+}
64+
65 static int is_common (void)
66 {
67 return (1);
68@@ -430,7 +435,8 @@ const distro_tbl_t distro_tbl[] = {
69 { &is_solaris, &get_runlevel_redhat },
70 { &is_wrlinux, &get_runlevel_wrlinux },
71 { &is_common, &get_runlevel_common },
72- { &is_openembedded, &get_runlevel_common }
73+ { &is_openembedded, &get_runlevel_common },
74+ { &is_poky, &get_runlevel_common }
75 };
76
77 #define DISTRO_TBL_SIZE ((sizeof distro_tbl)/sizeof (distro_tbl_t))
78--
792.25.1
80