From: "Miroslav Šulc" <fordfrog@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/tomcat/, www-servers/tomcat/files/
Date: Thu, 19 May 2016 19:58:34 +0000 (UTC) [thread overview]
Message-ID: <1463687915.a7b38fffb499e7639620acd866ba5a249a3c6497.fordfrog@gentoo> (raw)
commit: a7b38fffb499e7639620acd866ba5a249a3c6497
Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
AuthorDate: Thu May 19 19:58:16 2016 +0000
Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Thu May 19 19:58:35 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7b38fff
www-servers/tomcat: backported patch from M7 which fixes NPE in StandardJarScanner.processManifest()
Package-Manager: portage-2.3.0_rc1
.../tomcat-9.0.0_alpha6-processmanifest.patch | 76 ++++++++++++++++++++++
...alpha6.ebuild => tomcat-9.0.0_alpha6-r1.ebuild} | 2 +-
2 files changed, 77 insertions(+), 1 deletion(-)
diff --git a/www-servers/tomcat/files/tomcat-9.0.0_alpha6-processmanifest.patch b/www-servers/tomcat/files/tomcat-9.0.0_alpha6-processmanifest.patch
new file mode 100644
index 0000000..fa38d5d
--- /dev/null
+++ b/www-servers/tomcat/files/tomcat-9.0.0_alpha6-processmanifest.patch
@@ -0,0 +1,76 @@
+--- tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java 2016/05/04 11:07:55 1742251
++++ tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java 2016/05/17 07:18:38 1744194
+@@ -370,40 +370,42 @@
+ }
+
+ Manifest manifest = jar.getManifest();
+- Attributes attributes = manifest.getMainAttributes();
+- String classPathAttribute = attributes.getValue("Class-Path");
+- if (classPathAttribute == null) {
+- return;
+- }
+- String[] classPathEntries = classPathAttribute.split(" ");
+- for (String classPathEntry : classPathEntries) {
+- classPathEntry = classPathEntry.trim();
+- if (classPathEntry.length() == 0) {
+- continue;
++ if (manifest != null) {
++ Attributes attributes = manifest.getMainAttributes();
++ String classPathAttribute = attributes.getValue("Class-Path");
++ if (classPathAttribute == null) {
++ return;
+ }
+- URL jarURL = jar.getJarFileURL();
+- URI jarURI;
+- try {
+- jarURI = jarURL.toURI();
+- } catch (URISyntaxException e) {
+- if (log.isDebugEnabled()) {
+- log.debug(sm.getString("jarScan.invalidUri", jarURL));
++ String[] classPathEntries = classPathAttribute.split(" ");
++ for (String classPathEntry : classPathEntries) {
++ classPathEntry = classPathEntry.trim();
++ if (classPathEntry.length() == 0) {
++ continue;
++ }
++ URL jarURL = jar.getJarFileURL();
++ URI jarURI;
++ try {
++ jarURI = jarURL.toURI();
++ } catch (URISyntaxException e) {
++ if (log.isDebugEnabled()) {
++ log.debug(sm.getString("jarScan.invalidUri", jarURL));
++ }
++ continue;
+ }
+- continue;
++ /*
++ * Note: Resolving the relative URLs from the manifest has the
++ * potential to introduce security concerns. However, since
++ * only JARs provided by the container and NOT those provided
++ * by web applications are processed, there should be no
++ * issues.
++ * If this feature is ever extended to include JARs provided
++ * by web applications, checks should be added to ensure that
++ * any relative URL does not step outside the web application.
++ */
++ URI classPathEntryURI = jarURI.resolve(classPathEntry);
++ URL classPathEntryURL = classPathEntryURI.toURL();
++ classPathUrlsToProcess.add(classPathEntryURL);
+ }
+- /*
+- * Note: Resolving the relative URLs from the manifest has the
+- * potential to introduce security concerns. However, since
+- * only JARs provided by the container and NOT those provided
+- * by web applications are processed, there should be no
+- * issues.
+- * If this feature is ever extended to include JARs provided
+- * by web applications, checks should be added to ensure that
+- * any relative URL does not step outside the web application.
+- */
+- URI classPathEntryURI = jarURI.resolve(classPathEntry);
+- URL classPathEntryURL = classPathEntryURI.toURL();
+- classPathUrlsToProcess.add(classPathEntryURL);
+ }
+ }
+
diff --git a/www-servers/tomcat/tomcat-9.0.0_alpha6.ebuild b/www-servers/tomcat/tomcat-9.0.0_alpha6-r1.ebuild
similarity index 98%
rename from www-servers/tomcat/tomcat-9.0.0_alpha6.ebuild
rename to www-servers/tomcat/tomcat-9.0.0_alpha6-r1.ebuild
index 438086b..21e76fb 100644
--- a/www-servers/tomcat/tomcat-9.0.0_alpha6.ebuild
+++ b/www-servers/tomcat/tomcat-9.0.0_alpha6-r1.ebuild
@@ -52,7 +52,7 @@ java_prepare() {
# Remove bundled servlet-api
rm -rv java/javax/{el,servlet} || die
- epatch "${FILESDIR}/${P}-build.xml.patch"
+ epatch "${FILESDIR}/${P}-build.xml.patch" "${FILESDIR}/${P}-processmanifest.patch"
# For use of catalina.sh in netbeans
sed -i -e "/^# ----- Execute The Requested Command/ a\
next reply other threads:[~2016-05-19 19:58 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-19 19:58 Miroslav Šulc [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-06-07 6:38 [gentoo-commits] repo/gentoo:master commit in: www-servers/tomcat/, www-servers/tomcat/files/ Miroslav Šulc
2024-04-04 7:51 Miroslav Šulc
2023-03-23 5:48 Miroslav Šulc
2023-02-26 8:02 Miroslav Šulc
2023-02-26 7:40 Miroslav Šulc
2023-02-26 7:24 Miroslav Šulc
2022-09-28 4:33 Miroslav Šulc
2021-06-17 7:06 Miroslav Šulc
2021-05-13 11:22 Miroslav Šulc
2021-05-07 14:35 Miroslav Šulc
2021-02-04 10:08 Miroslav Šulc
2020-07-20 8:45 Miroslav Šulc
2020-07-14 16:41 Miroslav Šulc
2020-07-07 10:22 Miroslav Šulc
2020-04-30 9:16 Miroslav Šulc
2020-02-09 23:38 Miroslav Šulc
2019-10-16 10:51 Miroslav Šulc
2019-10-16 9:38 Miroslav Šulc
2019-10-16 8:38 Miroslav Šulc
2019-06-12 9:48 Miroslav Šulc
2019-04-19 15:45 Miroslav Šulc
2019-04-19 15:45 Miroslav Šulc
2019-04-19 15:20 Miroslav Šulc
2019-04-19 14:51 Miroslav Šulc
2019-03-20 16:49 Miroslav Šulc
2019-03-20 16:49 Miroslav Šulc
2019-03-19 19:05 Miroslav Šulc
2019-02-10 14:11 Miroslav Šulc
2019-01-23 12:49 Miroslav Šulc
2018-02-13 17:23 Miroslav Šulc
2018-02-13 17:23 Miroslav Šulc
2018-02-04 9:32 Miroslav Šulc
2017-12-04 15:02 Miroslav Šulc
2017-10-11 17:05 Miroslav Šulc
2017-10-11 15:13 Miroslav Šulc
2017-10-11 15:04 Miroslav Šulc
2017-09-10 6:46 Miroslav Šulc
2017-09-10 6:26 Miroslav Šulc
2017-08-20 13:54 Miroslav Šulc
2017-08-17 14:03 Miroslav Šulc
2017-08-10 10:35 Miroslav Šulc
2017-07-15 7:50 Miroslav Šulc
2017-05-16 8:56 Miroslav Šulc
2017-04-25 10:53 Miroslav Šulc
2017-03-14 15:15 Miroslav Šulc
2016-12-09 14:53 Miroslav Šulc
2016-11-15 15:07 Miroslav Šulc
2016-06-21 9:43 Miroslav Šulc
2016-06-14 11:51 Miroslav Šulc
2016-05-17 9:06 Miroslav Šulc
2016-04-18 16:16 Miroslav Šulc
2016-03-26 10:28 Miroslav Šulc
2016-03-22 21:16 James Le Cuirot
2016-03-17 12:53 Miroslav Šulc
2016-03-17 12:46 Miroslav Šulc
2016-02-10 14:48 Miroslav Šulc
2016-02-08 11:54 Miroslav Šulc
2015-12-07 14:02 Miroslav Šulc
2015-10-25 22:53 James Le Cuirot
2015-10-25 22:53 James Le Cuirot
2015-10-21 9:46 Miroslav Šulc
2015-09-03 16:55 Miroslav Šulc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1463687915.a7b38fffb499e7639620acd866ba5a249a3c6497.fordfrog@gentoo \
--to=fordfrog@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox