Skip to content

Commit b94cc01

Browse files
authored
feat(checker): Add enscript Checker (#1216)
1 parent 0ae357a commit b94cc01

File tree

6 files changed

+60
-0
lines changed

6 files changed

+60
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"dnsmasq",
2626
"dovecot",
2727
"dpkg",
28+
"enscript",
2829
"expat",
2930
"ffmpeg",
3031
"freeradius",

cve_bin_tool/checkers/enscript.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (C) 2021 Intel Corporation
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for enscript
7+
8+
https://www.cvedetails.com/product/1800/?q=Enscript
9+
10+
"""
11+
from cve_bin_tool.checkers import Checker
12+
13+
14+
class EnscriptChecker(Checker):
15+
CONTAINS_PATTERNS = [
16+
r"set the PostScript language level that enscript",
17+
r"or set the environment variable `ENSCRIPT_LIBRARY' to point to your library directory.",
18+
]
19+
FILENAME_PATTERNS = [r"enscript"]
20+
VERSION_PATTERNS = [r"GNU Enscript ([0-9]+\.[0-9]+\.[0-9]+)"]
21+
VENDOR_PRODUCT = [("gnu", "enscript")]
12.6 KB
Binary file not shown.
29.5 KB
Binary file not shown.

test/test_data/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"dnsmasq",
1717
"dovecot",
1818
"dpkg",
19+
"enscript",
1920
"expat",
2021
"ffmpeg",
2122
"freeradius",

test/test_data/enscript.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (C) 2021 Intel Corporation
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "enscript",
7+
"version": "1.6.6",
8+
"version_strings": [
9+
"set the PostScript language level that enscript",
10+
"or set the environment variable `ENSCRIPT_LIBRARY' to point to your library directory.",
11+
"GNU Enscript 1.6.6",
12+
],
13+
},
14+
{
15+
"product": "enscript",
16+
"version": "1.6.5",
17+
"version_strings": [
18+
"set the PostScript language level that enscript",
19+
"or set the environment variable `ENSCRIPT_LIBRARY' to point to your library directory.",
20+
"GNU Enscript 1.6.5",
21+
],
22+
},
23+
]
24+
package_test_data = [
25+
{
26+
"url": "http://mirror.centos.org/altarch/7/os/aarch64/Packages/",
27+
"package_name": "enscript-1.6.6-7.el7.aarch64.rpm",
28+
"product": "enscript",
29+
"version": "1.6.6",
30+
},
31+
{
32+
"url": "http://archive.ubuntu.com/ubuntu/pool/universe/e/enscript/",
33+
"package_name": "enscript_1.6.5.90-3_amd64.deb",
34+
"product": "enscript",
35+
"version": "1.6.5",
36+
},
37+
]

0 commit comments

Comments
 (0)