Blame SOURCES/fapolicyd-java4.patch

0af8c4
From 2ac23e04f3f14716cf4493fc30eb6ad63760d945 Mon Sep 17 00:00:00 2001
0af8c4
From: Alexander Scheel <alexander.m.scheel@gmail.com>
0af8c4
Date: Wed, 11 Nov 2020 07:26:29 -0500
0af8c4
Subject: [PATCH] Allow .class files instead of .java files (#101)
0af8c4
0af8c4
.java files themselves aren't directly executable using the default java
0af8c4
program; instead, they must first be compiled to .class files (using
0af8c4
javac) before they can be executed via java. This means that .java files
0af8c4
shipped in RPMs (as say, API usage examples) won't be executed and don't
0af8c4
necessarily need to be. They could however, be compiled first and then
0af8c4
executed as .class; however, this resulting .class file should likely be
0af8c4
somewhere other than /usr/share if it wasn't distributed by the RPM
0af8c4
itself.
0af8c4
0af8c4
Signed-off-by: Alexander Scheel <ascheel@redhat.com>
0af8c4
---
0af8c4
 src/library/rpm-backend.c | 2 +-
0af8c4
 1 file changed, 1 insertion(+), 1 deletion(-)
0af8c4
0af8c4
diff --git a/src/library/rpm-backend.c b/src/library/rpm-backend.c
0af8c4
index ba648d3..111e9f2 100644
0af8c4
--- a/src/library/rpm-backend.c
0af8c4
+++ b/src/library/rpm-backend.c
0af8c4
@@ -237,7 +237,7 @@ static int drop_path(const char *file_name)
0af8c4
 						 file_name, 0) == 0)
0af8c4
 					return 0;
0af8c4
 				// Java
0af8c4
-				else if (fnmatch("*.java",
0af8c4
+				else if (fnmatch("*.class",
0af8c4
 						 file_name, 0) == 0)
0af8c4
 					return 0;
0af8c4
 				return 1;