-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incorrect regex matching for rhel6 #436
Comments
Could this be as simple as changing the order in which the os is evaluated. Basically evaluating rhel first. Not sure if I might be missing something but put together a working example that works and one that doesn't. |
If you run the same command on Oracle Linux, it returns the same value:
So, we have to test for Oracle Linux first, using
That's why |
If its iterating over these values in that order wouldn't it look for /etc/oracle-release first?
|
I'll leave this up to @jzelinskie to debug. |
We've just encountered the same issue. I think to fix it we may need to tweak the regexes. What seems to be happening is it first looks for the Oracle match (
This results in the namespace being incorrectly identified as 'enterprise' as match 1 is then taken and lowercased on https://github.com/coreos/clair/blob/master/ext/featurens/redhatrelease/redhatrelease.go#L57 Is there a reason the Oracle regex doesn't just say |
When trying to identify various RedHat releases, RHEL was not being picked up as a centos release because the Oracle Linux regex was too permissive: it would match any release name with '<something> Linux Server release' in the name. By being more restrictive with the Oracle regex, RHEL is now properly identified. I don't know why the Oracle regex used such a permissive matcher for the name but it still passes all the tests by replacing it with the word 'Oracle'. Fixes quay#436
When trying to identify various RedHat releases, RHEL was not being picked up as a centos release because the Oracle Linux regex was too permissive: it would match any release name with '<something> Linux Server release' in the name. By being more restrictive with the Oracle regex, RHEL is now properly identified. I don't know why the Oracle regex used such a permissive matcher for the name but it still passes all the tests by replacing it with the word 'Oracle'. Fixes quay#436
When trying to identify various RedHat releases, RHEL was not being picked up as a centos release because the Oracle Linux regex was too permissive: it would match any release name with '<something> Linux Server release' in the name. By being more restrictive with the Oracle regex, RHEL is now properly identified. I don't know why the Oracle regex used such a permissive matcher for the name but it still passes all the tests by replacing it with the word 'Oracle'. Fixes quay#436
When using rhel6 as the base os
/etc/redhat-release
is how the os version is identified:This file matches the regex used to identify oracle linux and outputs an invalid os name to the clair database:
The result is that this image is not checked against the correct CVEs and will show up as passed in the registry.
https://play.golang.org/p/P4K8HDyAFG
https://github.com/coreos/clair/blob/master/ext/featurens/redhatrelease/redhatrelease.go#L54
@Djelibeybi @jzelinskie
The text was updated successfully, but these errors were encountered: