Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[policies] Fix bug in distro identification
Fixes a bug in #3764. A bug in the distro-identifying logic caused incorrect identification of the distro as CentOS, Fedora, or RHEL under the following conditions: 1. Distro inherits RedHatPolicy 2. Distro has either of /etc/{centos,fedora,redhat}-release 3. Policy file appears earlier than redhat.py in dictionary order The issue occurs because the distro-identifying logic relies on the existence of the above os_release_file without examining its contents, more than checking NAME or ID in the /etc/os-release file. As a result, once /etc/{centos,fedora,redhat}-release is found, the contents of /etc/os-release are never checked, leading to distro misidentification. At least AlmaLinux is affected by this bug. Signed-off-by: Koichiro Iwao <[email protected]>
- Loading branch information