aboutsummaryrefslogtreecommitdiffstats
path: root/english/security/oval
diff options
context:
space:
mode:
authorCathy Young <youngcat@uk.ibm.com>2022-03-03 12:01:00 +0000
committerSebastien Delafond <seb@debian.org>2022-04-13 08:29:48 +0000
commit08ab9f9e259c5c099cb152e3272f2372b54ef3da (patch)
tree5cd56d9cb6c902523353eef955d7f3affcc947c3 /english/security/oval
parentdb3c16a066355af630de96e011541fd523a7b343 (diff)
Add default epoch 0: to version for evr if none defined
Diffstat (limited to 'english/security/oval')
-rw-r--r--english/security/oval/oval/definition/generator.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/english/security/oval/oval/definition/generator.py b/english/security/oval/oval/definition/generator.py
index 7fceeabb436..ed625610f55 100644
--- a/english/security/oval/oval/definition/generator.py
+++ b/english/security/oval/oval/definition/generator.py
@@ -151,6 +151,15 @@ def __createOVALUnameObject ():
return (testsHash["obj"][name])
+def __getEvr(value):
+ """ Generate evr from version
+
+ Prepend "0:" if no epoch already
+ """
+ if ":" not in value:
+ value = "0:"+value
+ return value
+
def __createOVALState (value, operation = "less than"):
""" Generate OVAL state definition
@@ -164,7 +173,7 @@ def __createOVALState (value, operation = "less than"):
attrs={"id":stateId,
"version":"1",
"xmlns":"http://oval.mitre.org/XMLSchema/oval-definitions-5#linux"})
- state.append ( __createXMLElement ("evr", "0:"+value,
+ state.append ( __createXMLElement ("evr", __getEvr(value),
{"datatype":"debian_evr_string",
"operation":operation}))
states.append (state)

© 2014-2024 Faster IT GmbH | imprint | privacy policy