Skip to content

Commit

Permalink
fix: improve janus signature (#2691)
Browse files Browse the repository at this point in the history
Improve janus signature to avoid catching the string 0.1.19 in version
1.1.0

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
  • Loading branch information
ffontaine committed Feb 13, 2023
1 parent 2b4f219 commit 059c566
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cve_bin_tool/checkers/janus.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class JanusChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\njanus",
r"not-a-git-repo\r?\n([0-9]+\.[0-9]+\.[0-9]+)\r?\njanus",
r"janus[a-z_]*\r?\n([0-9]+\.[0-9]+\.[0-9]+)",
]
VENDOR_PRODUCT = [("meetecho", "janus")]
6 changes: 5 additions & 1 deletion test/test_data/janus.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{"product": "janus", "version": "1.1.0", "version_strings": ["1.1.0\njanus"]},
{
"product": "janus",
"version": "1.1.0",
"version_strings": ["not-a-git-repo\n1.1.0\njanus"],
},
{"product": "janus", "version": "0.9.2", "version_strings": ["janus_mkdir\n0.9.2"]},
]
package_test_data = [
Expand Down

0 comments on commit 059c566

Please sign in to comment.