Blob Blame History Raw
From 32a47ce0557c9b38ee59acec97d8f5bd01b4751d Mon Sep 17 00:00:00 2001
From: Steve Grubb <sgrubb@redhat.com>
Date: Tue, 10 Nov 2020 11:47:37 -0500
Subject: [PATCH] Pickup more languages in /usr/share

It turns out that there is a lot of languages placing code for execution
in /usr/share. This patch widens the filter so that more file extensions
are included in the trust database. Without this, access to pki-ca.jar,
for example, is denied access.
---
 src/library/rpm-backend.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/src/library/rpm-backend.c b/src/library/rpm-backend.c
index 25f867a..6ce8a2d 100644
--- a/src/library/rpm-backend.c
+++ b/src/library/rpm-backend.c
@@ -183,6 +183,7 @@ static int drop_path(const char *file_name)
 			// Drop anything in /usr/share that's
 			// not python, javascript, or has a libexec dir
 			if (file_name[6] == 'h' ) {
+				// These are roughly ordered by quantity
 				if (fnmatch("*.py?",
 						 file_name, 0) == 0)
 					return 0;
@@ -192,9 +193,39 @@ static int drop_path(const char *file_name)
 				else if (fnmatch("*/libexec/*",
 						file_name, 0) == 0)
 					return 0;
+				else if (fnmatch("*.rb",
+						 file_name, 0) == 0)
+					return 0;
+				else if (fnmatch("*.pl",
+						 file_name, 0) == 0)
+					return 0;
+				else if (fnmatch("*.stp",
+						 file_name, 0) == 0)
+					return 0;
 				else if (fnmatch("*.js",
 						 file_name, 0) == 0)
 					return 0;
+				else if (fnmatch("*.jar",
+						 file_name, 0) == 0)
+					return 0;
+				else if (fnmatch("*.m4",
+						 file_name, 0) == 0)
+					return 0;
+				else if (fnmatch("*.php",
+						 file_name, 0) == 0)
+					return 0;
+				else if (fnmatch("*.el",
+						 file_name, 0) == 0)
+					return 0;
+				else if (fnmatch("*.pm",
+						 file_name, 0) == 0)
+					return 0;
+				else if (fnmatch("*.lua",
+						 file_name, 0) == 0)
+					return 0;
+				else if (fnmatch("*.java",
+						 file_name, 0) == 0)
+					return 0;
 				return 1;
 			// Akmod need scripts in /usr/src/kernel
 			} else if (file_name[6] == 'r' ) {