Bash, Ansible, and OVAL analysis can be started either by changing "raw" file (mostly those files are in linux_os/ directory with shared.(xml|yml|sh) filename) or by changing Jinja macro which invokes build and then built file analysis (files in build/ directory).
Analysis needs to get a rule name. In the "raw" file change case, it is name of folder. In the second case, it is name of a script (e.g. build/rhel8/fixes/bash/zipl_vsyscall_argument.sh).
The problem was that recognizing was done based on shared filename. But this doesn't work when the filename is e.g. ubuntu. So this PR changes the recognition to a folder name - if a file is in fixes (or checks in OVAL analysis) folder, then we are analyzing built file, otherwise "raw" file is being analyzed.
Bash, Ansible, and OVAL analysis can be started either by changing "raw" file (mostly those files are in
linux_os/
directory withshared.(xml|yml|sh)
filename) or by changing Jinja macro which invokes build and then built file analysis (files inbuild/
directory).Analysis needs to get a rule name. In the "raw" file change case, it is name of folder. In the second case, it is name of a script (e.g.
build/rhel8/fixes/bash/zipl_vsyscall_argument.sh
).The problem was that recognizing was done based on
shared
filename. But this doesn't work when the filename is e.g.ubuntu
. So this PR changes the recognition to a folder name - if a file is infixes
(orchecks
in OVAL analysis) folder, then we are analyzing built file, otherwise "raw" file is being analyzed.Fixes #24