Skip to content

Commit

Permalink
Remove host specific paths from hash signature
Browse files Browse the repository at this point in the history
variables like BBINCLUDED, BBLAYERS, TOPDIR and SCA_LAYERDIR
should not be part of the task hash, as they are
host specific - exclude them from the hash

Closes #9492

Signed-off-by: Konrad Weihmann <[email protected]>
  • Loading branch information
priv-kweihmann committed Mar 29, 2022
1 parent 1b9bf1f commit f044511
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions classes/sca-cvecheck.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ inherit sca-image-backtrack

# override some variables till an upstream fix is available
CVE_CHECK_DB_DIR = "${TOPDIR}/downloads/CVE_CHECK"
CVE_CHECK_DB_DIR[vardepsexclude] += "TOPDIR"

SCA_RAW_RESULT_FILE[cvecheck] = "json"

Expand Down
3 changes: 3 additions & 0 deletions classes/sca-datamodel.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def sca_datamodel_bbfiles(d):
x = x.replace(y, "", 1)
res.add(x.lstrip("/"))
return sorted(res)
sca_datamodel_bbfiles[vardepsexclude] += "BBINCLUDED BBLAYERS"

def sca_get_model_class(d, **kwargs):
__SevTrans = sca_severity_transformation(d)
Expand Down Expand Up @@ -285,6 +286,8 @@ def sca_get_model_class(d, **kwargs):
x.AddDescription(d.getVar("STAGING_DATADIR_NATIVE"))
return x

sca_get_model_class[vardepsexclude] += "BBLAYERS"

def __sca_model_to_list(d, list):
return [x.ToDict() for x in list]

Expand Down
3 changes: 3 additions & 0 deletions classes/sca-global.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,6 @@ SCA_HASHEXCLUDE_VARS = "\
SCA_DATAMODEL_STORAGE \
SCA_LAYERDIR \
"

# some global vardepexcludes
LIC_FILES_CHKSUM[vardepsexclude] += "SCA_LAYERDIR"
3 changes: 2 additions & 1 deletion classes/sca-mypy-core.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def do_sca_conv_mypy(d):
sca_add_model_class_list(d, _findings)
return sca_save_model_to_string(d)

do_sca_conv_mypy[vardepsexclude] += "TOPDIR"

python do_sca_mypy_core() {
import os
import subprocess
Expand All @@ -76,7 +78,6 @@ python do_sca_mypy_core() {
o.write(cmd_output)
}

do_sca_mypy_core[vardepsexclude] += "TOPDIR"
python do_sca_mypy_core_report() {
import os
## Create data model
Expand Down
4 changes: 3 additions & 1 deletion classes/sca-pkgqaenc-shellident.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ def do_sca_pkgqaenc_shelllist(d, package):
res += do_sca_pkgqaenc_warning("pkgqaenc.pkgqaenc.missingprodiver", file,
"Package {pkg} uses {bin}, but no provider for this file can be found".format(
bin=bin, pkg=package))
return res
return res

do_sca_pkgqaenc_shelllist[vardepsexclude] += "TOPDIR"
2 changes: 2 additions & 0 deletions classes/sca-semgrep.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def do_sca_conv_semgrep(d):
sca_add_model_class_list(d, _findings)
return sca_save_model_to_string(d)

do_sca_conv_semgrep[vardepsexclude] += "TOPDIR"

python do_sca_semgrep() {
import os
import subprocess
Expand Down
3 changes: 2 additions & 1 deletion classes/sca-vulture-core.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def do_sca_conv_vulture(d):
sca_add_model_class_list(d, _findings)
return sca_save_model_to_string(d)

do_sca_vulture_core[vardepsexclude] += "BB_NUMBER_THREADS"
do_sca_conv_vulture[vardepsexclude] += "TOPDIR"

python do_sca_vulture_core() {
import os
import subprocess
Expand Down
1 change: 1 addition & 0 deletions recipes-appends/cve-update-db-native.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ inherit cve-check
# Note: if you use different settings, please adjust them here
# as well
CVE_CHECK_DB_DIR ?= "${TOPDIR}/downloads/CVE_CHECK"
CVE_CHECK_DB_DIR[vardepsexclude] = "TOPDIR"
CVE_CHECK_DB_FILE ?= "${CVE_CHECK_DB_DIR}/nvdcve_1.1.db"
CVE_CHECK_DB_FILE_LOCK ?= "${CVE_CHECK_DB_FILE}.lock"

0 comments on commit f044511

Please sign in to comment.