Blame SOURCES/fapolicyd-java4.patch

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