public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-forensics/yara/, app-forensics/yara/files/
@ 2023-01-03  0:32 Sam James
  0 siblings, 0 replies; only message in thread
From: Sam James @ 2023-01-03  0:32 UTC (permalink / raw
  To: gentoo-commits

commit:     11889b62058455ca061e0c0376a1db3716c97750
Author:     Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Mon Jan  2 19:59:15 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan  3 00:32:18 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11889b62

app-forensics/yara: fix test with sys-apps/file-5.44

Closes: https://bugs.gentoo.org/889182
Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Closes: https://github.com/gentoo/gentoo/pull/28941
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-forensics/yara/files/yara-4.2.3-libmagic.patch | 65 ++++++++++++++++++++++
 app-forensics/yara/yara-4.2.3.ebuild               |  7 ++-
 2 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/app-forensics/yara/files/yara-4.2.3-libmagic.patch b/app-forensics/yara/files/yara-4.2.3-libmagic.patch
new file mode 100644
index 000000000000..96d98b8821c5
--- /dev/null
+++ b/app-forensics/yara/files/yara-4.2.3-libmagic.patch
@@ -0,0 +1,65 @@
+Bug: https://bugs.gentoo.org/889182
+Bug: https://github.com/VirusTotal/yara/pull/1845
+
+From 0939464c359b4718779b9f071029624df98bae39 Mon Sep 17 00:00:00 2001
+From: Hilko Bengen <bengen@hilluzination.de>
+Date: Thu, 29 Dec 2022 00:06:40 +0100
+Subject: [PATCH] test-magic: Update expected strings
+
+As of file 5.44, some PE-related strings and MIME types have been
+updated, causing the test to fail.
+
+See [Debian bug#1027031](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1027031)
+---
+ tests/test-magic.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test-magic.c b/tests/test-magic.c
+index ff2f34c86..1d685e3dd 100644
+--- a/tests/test-magic.c
++++ b/tests/test-magic.c
+@@ -23,8 +23,10 @@ int main(int argc, char** argv)
+ 
+   assert_true_rule_blob(
+       "import \"magic\" rule test { condition: \
+-      magic.type() contains \"MS-DOS executable\" and \
+-      magic.mime_type() == \"application/x-dosexec\" }",
++      ( magic.type() contains \"MS-DOS executable\" or \
++        magic.type() contains \"PE32+ executable\" ) and                                                      \
++      ( magic.mime_type() == \"application/x-dosexec\" or \
++        magic.mime_type() == \"application/vnd.microsoft.portable-executable\" ) }",
+       PE32_FILE);
+ 
+   // Test case for https://github.com/VirusTotal/yara/issues/1663
+Bug: https://github.com/VirusTotal/yara/pull/1853
+
+From 1b5d787701e124a829af03cdb0009e48dc492aba Mon Sep 17 00:00:00 2001
+From: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
+Date: Mon, 2 Jan 2023 20:37:59 +0100
+Subject: [PATCH] test-magic: Update expected strings (#1853)
+
+As of file 5.44, some PE-related strings and MIME types have been
+updated, causing the test to fail. This commit extends the fix in
+0939464c359b4718779b9f071029624df98bae39 to cover more cases.
+
+closes #1853
+
+See [Gentoo bug#889182](https://bugs.gentoo.org/889182)
+---
+ tests/test-magic.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test-magic.c b/tests/test-magic.c
+index 1d685e3d..0a327ee4 100644
+--- a/tests/test-magic.c
++++ b/tests/test-magic.c
+@@ -24,7 +24,8 @@ int main(int argc, char** argv)
+   assert_true_rule_blob(
+       "import \"magic\" rule test { condition: \
+       ( magic.type() contains \"MS-DOS executable\" or \
+-        magic.type() contains \"PE32+ executable\" ) and                                                      \
++        magic.type() contains \"PE32+ executable\" or \
++        magic.type() contains \"PE32 executable\") and \
+       ( magic.mime_type() == \"application/x-dosexec\" or \
+         magic.mime_type() == \"application/vnd.microsoft.portable-executable\" ) }",
+       PE32_FILE);

diff --git a/app-forensics/yara/yara-4.2.3.ebuild b/app-forensics/yara/yara-4.2.3.ebuild
index b8909f518de2..d22595e779f4 100644
--- a/app-forensics/yara/yara-4.2.3.ebuild
+++ b/app-forensics/yara/yara-4.2.3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -26,7 +26,10 @@ DEPEND="
 RDEPEND="${DEPEND}"
 PDEPEND="python? ( =dev-python/yara-python-$(ver_cut 1)* )"
 
-PATCHES=( "${FILESDIR}/${PN}-$(ver_cut 1-2)-test.patch" )
+PATCHES=(
+	"${FILESDIR}/${PN}-$(ver_cut 1-2)-test.patch"
+	"${FILESDIR}/${P}-libmagic.patch"
+)
 
 src_prepare() {
 	default


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-03  0:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-03  0:32 [gentoo-commits] repo/gentoo:master commit in: app-forensics/yara/, app-forensics/yara/files/ Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox