diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2020-02-27 12:24:56 +0800 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2020-03-05 07:20:07 -0800 |
commit | b23e7eac2d4f40acf1d40cb3d8ba9dc2756d37f7 (patch) | |
tree | df1c1c90cf1def11c4d1c4dd127d821589603885 /meta-security-compliance | |
parent | 17b0f4264743e3849181215d2a28711278636b0b (diff) | |
download | meta-security-b23e7eac2d4f40acf1d40cb3d8ba9dc2756d37f7.tar.gz |
scap-security-guide: pass the correct schema file path to openscap-native
There is a build error when using openscap-native sstate cache.
Steps to reproduce:
Create a new build project in build-1 directory.
$ bitbake openscap-native
Then remove the whole build directory only keep the sstate-cache
directory as a sstate mirror.
Create another new build project in build-2 directory.
Set SSTATE_MIRRORS
$ bitbake scap-security-guide
Error message:
OpenSCAP Error: Schema file 'xccdf/1.1/xccdf-schema.xsd' not found in path
'/buildarea/build-1/tmp/work-shared/openscap/oscap-build-artifacts/usr/share/openscap/schemas' when trying to validate
'/buildarea/build-2/tmp/work/core2-64-poky-linux/scap-security-guide/0.1.44+gitAUTOINC+5fdfdcb2e9-r0/git/build/jre/xccdf-unlinked-resolved.xml'
[/buildarea/build-1/tmp/work/x86_64-linux/openscap-native/1.3.1+gitAUTOINC+4bbdb46ff6-r0/git/src/source/validate.c:104]
The oscap command from openscap-native tries to find the schema files in
build-1 directory since these paths are hardcoded when building
openscap-native.
We need to pass the correct schema/xslt/cpe paths to oscap to make sure
it can find the files in right location.
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-security-compliance')
-rw-r--r-- | meta-security-compliance/recipes-openscap/scap-security-guide/scap-security-guide.inc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/meta-security-compliance/recipes-openscap/scap-security-guide/scap-security-guide.inc b/meta-security-compliance/recipes-openscap/scap-security-guide/scap-security-guide.inc index 3212310..66c2623 100644 --- a/meta-security-compliance/recipes-openscap/scap-security-guide/scap-security-guide.inc +++ b/meta-security-compliance/recipes-openscap/scap-security-guide/scap-security-guide.inc | |||
@@ -13,6 +13,9 @@ S = "${WORKDIR}/git" | |||
13 | inherit cmake pkgconfig python3native | 13 | inherit cmake pkgconfig python3native |
14 | 14 | ||
15 | STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts" | 15 | STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts" |
16 | export OSCAP_CPE_PATH="${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/cpe" | ||
17 | export OSCAP_SCHEMA_PATH="${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/schemas" | ||
18 | export OSCAP_XSLT_PATH="${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/xsl" | ||
16 | 19 | ||
17 | OECMAKE_GENERATOR = "Unix Makefiles" | 20 | OECMAKE_GENERATOR = "Unix Makefiles" |
18 | 21 | ||