Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B6AC6200B99 for ; Wed, 5 Oct 2016 11:30:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B5437160ADE; Wed, 5 Oct 2016 09:30:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 06078160ADB for ; Wed, 5 Oct 2016 11:30:13 +0200 (CEST) Received: (qmail 57914 invoked by uid 500); 5 Oct 2016 09:30:12 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 57904 invoked by uid 99); 5 Oct 2016 09:30:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2016 09:30:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 71B35C059C for ; Wed, 5 Oct 2016 09:30:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id ojmggMFPynCO for ; Wed, 5 Oct 2016 09:30:11 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTP id 85E595FC17 for ; Wed, 5 Oct 2016 09:30:11 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 703DAE0425 for ; Wed, 5 Oct 2016 09:30:10 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id ECBDB3A00EC for ; Wed, 5 Oct 2016 09:30:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1763372 - /tomcat/trunk/java/org/apache/catalina/webresources/war/Handler.java Date: Wed, 05 Oct 2016 09:30:09 -0000 To: dev@tomcat.apache.org From: markt@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20161005093009.ECBDB3A00EC@svn01-us-west.apache.org> archived-at: Wed, 05 Oct 2016 09:30:14 -0000 Author: markt Date: Wed Oct 5 09:30:09 2016 New Revision: 1763372 URL: http://svn.apache.org/viewvc?rev=1763372&view=rev Log: Add a work-around for poorly constructed "war:..." URLs obtained from the security policy file. Modified: tomcat/trunk/java/org/apache/catalina/webresources/war/Handler.java Modified: tomcat/trunk/java/org/apache/catalina/webresources/war/Handler.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/war/Handler.java?rev=1763372&r1=1763371&r2=1763372&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/webresources/war/Handler.java (original) +++ tomcat/trunk/java/org/apache/catalina/webresources/war/Handler.java Wed Oct 5 09:30:09 2016 @@ -27,4 +27,20 @@ public class Handler extends URLStreamHa protected URLConnection openConnection(URL u) throws IOException { return new WarURLConnection(u); } + + @Override + protected void setURL(URL u, String protocol, String host, int port, String authority, String userInfo, String path, + String query, String ref) { + if (path.startsWith("file:") && !path.startsWith("file:/")) { + // Work around a problem with the URLs in the security policy file. + // On Windows, the use of ${catalina.[home|base]} in the policy file + // results in codebase URLs of the form file:C:/... when they should + // be file:/C:/... + // For file: and jar: URLs, the JRE compensates for this. It does not + // compensate for this for war:file:... URLs. Therefore, we do that + // here + path = "file:/" + path.substring(5); + } + super.setURL(u, protocol, host, port, authority, userInfo, path, query, ref); + } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org