1 |
commit: 11889b62058455ca061e0c0376a1db3716c97750 |
2 |
Author: Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de> |
3 |
AuthorDate: Mon Jan 2 19:59:15 2023 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 3 00:32:18 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11889b62 |
7 |
|
8 |
app-forensics/yara: fix test with sys-apps/file-5.44 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/889182 |
11 |
Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de> |
12 |
Closes: https://github.com/gentoo/gentoo/pull/28941 |
13 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
14 |
|
15 |
app-forensics/yara/files/yara-4.2.3-libmagic.patch | 65 ++++++++++++++++++++++ |
16 |
app-forensics/yara/yara-4.2.3.ebuild | 7 ++- |
17 |
2 files changed, 70 insertions(+), 2 deletions(-) |
18 |
|
19 |
diff --git a/app-forensics/yara/files/yara-4.2.3-libmagic.patch b/app-forensics/yara/files/yara-4.2.3-libmagic.patch |
20 |
new file mode 100644 |
21 |
index 000000000000..96d98b8821c5 |
22 |
--- /dev/null |
23 |
+++ b/app-forensics/yara/files/yara-4.2.3-libmagic.patch |
24 |
@@ -0,0 +1,65 @@ |
25 |
+Bug: https://bugs.gentoo.org/889182 |
26 |
+Bug: https://github.com/VirusTotal/yara/pull/1845 |
27 |
+ |
28 |
+From 0939464c359b4718779b9f071029624df98bae39 Mon Sep 17 00:00:00 2001 |
29 |
+From: Hilko Bengen <bengen@×××××××××××××.de> |
30 |
+Date: Thu, 29 Dec 2022 00:06:40 +0100 |
31 |
+Subject: [PATCH] test-magic: Update expected strings |
32 |
+ |
33 |
+As of file 5.44, some PE-related strings and MIME types have been |
34 |
+updated, causing the test to fail. |
35 |
+ |
36 |
+See [Debian bug#1027031](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1027031) |
37 |
+--- |
38 |
+ tests/test-magic.c | 6 ++++-- |
39 |
+ 1 file changed, 4 insertions(+), 2 deletions(-) |
40 |
+ |
41 |
+diff --git a/tests/test-magic.c b/tests/test-magic.c |
42 |
+index ff2f34c86..1d685e3dd 100644 |
43 |
+--- a/tests/test-magic.c |
44 |
++++ b/tests/test-magic.c |
45 |
+@@ -23,8 +23,10 @@ int main(int argc, char** argv) |
46 |
+ |
47 |
+ assert_true_rule_blob( |
48 |
+ "import \"magic\" rule test { condition: \ |
49 |
+- magic.type() contains \"MS-DOS executable\" and \ |
50 |
+- magic.mime_type() == \"application/x-dosexec\" }", |
51 |
++ ( magic.type() contains \"MS-DOS executable\" or \ |
52 |
++ magic.type() contains \"PE32+ executable\" ) and \ |
53 |
++ ( magic.mime_type() == \"application/x-dosexec\" or \ |
54 |
++ magic.mime_type() == \"application/vnd.microsoft.portable-executable\" ) }", |
55 |
+ PE32_FILE); |
56 |
+ |
57 |
+ // Test case for https://github.com/VirusTotal/yara/issues/1663 |
58 |
+Bug: https://github.com/VirusTotal/yara/pull/1853 |
59 |
+ |
60 |
+From 1b5d787701e124a829af03cdb0009e48dc492aba Mon Sep 17 00:00:00 2001 |
61 |
+From: Mario Haustein <mario.haustein@×××××××××××××××.de> |
62 |
+Date: Mon, 2 Jan 2023 20:37:59 +0100 |
63 |
+Subject: [PATCH] test-magic: Update expected strings (#1853) |
64 |
+ |
65 |
+As of file 5.44, some PE-related strings and MIME types have been |
66 |
+updated, causing the test to fail. This commit extends the fix in |
67 |
+0939464c359b4718779b9f071029624df98bae39 to cover more cases. |
68 |
+ |
69 |
+closes #1853 |
70 |
+ |
71 |
+See [Gentoo bug#889182](https://bugs.gentoo.org/889182) |
72 |
+--- |
73 |
+ tests/test-magic.c | 3 ++- |
74 |
+ 1 file changed, 2 insertions(+), 1 deletion(-) |
75 |
+ |
76 |
+diff --git a/tests/test-magic.c b/tests/test-magic.c |
77 |
+index 1d685e3d..0a327ee4 100644 |
78 |
+--- a/tests/test-magic.c |
79 |
++++ b/tests/test-magic.c |
80 |
+@@ -24,7 +24,8 @@ int main(int argc, char** argv) |
81 |
+ assert_true_rule_blob( |
82 |
+ "import \"magic\" rule test { condition: \ |
83 |
+ ( magic.type() contains \"MS-DOS executable\" or \ |
84 |
+- magic.type() contains \"PE32+ executable\" ) and \ |
85 |
++ magic.type() contains \"PE32+ executable\" or \ |
86 |
++ magic.type() contains \"PE32 executable\") and \ |
87 |
+ ( magic.mime_type() == \"application/x-dosexec\" or \ |
88 |
+ magic.mime_type() == \"application/vnd.microsoft.portable-executable\" ) }", |
89 |
+ PE32_FILE); |
90 |
|
91 |
diff --git a/app-forensics/yara/yara-4.2.3.ebuild b/app-forensics/yara/yara-4.2.3.ebuild |
92 |
index b8909f518de2..d22595e779f4 100644 |
93 |
--- a/app-forensics/yara/yara-4.2.3.ebuild |
94 |
+++ b/app-forensics/yara/yara-4.2.3.ebuild |
95 |
@@ -1,4 +1,4 @@ |
96 |
-# Copyright 1999-2022 Gentoo Authors |
97 |
+# Copyright 1999-2023 Gentoo Authors |
98 |
# Distributed under the terms of the GNU General Public License v2 |
99 |
|
100 |
EAPI=8 |
101 |
@@ -26,7 +26,10 @@ DEPEND=" |
102 |
RDEPEND="${DEPEND}" |
103 |
PDEPEND="python? ( =dev-python/yara-python-$(ver_cut 1)* )" |
104 |
|
105 |
-PATCHES=( "${FILESDIR}/${PN}-$(ver_cut 1-2)-test.patch" ) |
106 |
+PATCHES=( |
107 |
+ "${FILESDIR}/${PN}-$(ver_cut 1-2)-test.patch" |
108 |
+ "${FILESDIR}/${P}-libmagic.patch" |
109 |
+) |
110 |
|
111 |
src_prepare() { |
112 |
default |