You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2016/10/23 17:16:18 UTC

[3/4] jena git commit: Record needed code to enable more general symbolic link handling.

Record needed code to enable more general symbolic link handling.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/ffdb8d36
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/ffdb8d36
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/ffdb8d36

Branch: refs/heads/master
Commit: ffdb8d36a820d9172d2d18e47106d4f8e64e357d
Parents: 26fcbc5
Author: Andy Seaborne <an...@apache.org>
Authored: Sun Oct 23 15:52:46 2016 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Sun Oct 23 15:52:46 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/jena/fuseki/jetty/JettyFuseki.java    | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/ffdb8d36/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/jetty/JettyFuseki.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/jetty/JettyFuseki.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/jetty/JettyFuseki.java
index 7e8f405..00b6658 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/jetty/JettyFuseki.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/jetty/JettyFuseki.java
@@ -37,6 +37,8 @@ import org.eclipse.jetty.security.authentication.BasicAuthenticator ;
 import org.eclipse.jetty.server.HttpConnectionFactory ;
 import org.eclipse.jetty.server.Server ;
 import org.eclipse.jetty.server.ServerConnector ;
+import org.eclipse.jetty.server.handler.AllowSymLinkAliasChecker ;
+import org.eclipse.jetty.server.handler.ContextHandler ;
 import org.eclipse.jetty.server.handler.gzip.GzipHandler ;
 import org.eclipse.jetty.servlet.ServletContextHandler ;
 import org.eclipse.jetty.util.security.Constraint ;
@@ -245,6 +247,14 @@ public class JettyFuseki {
             defaultServerConfig(serverConfig.port, serverConfig.loopback) ;
 
         WebAppContext webapp = createWebApp(contextPath) ;
+        if ( false /*enable symbolic links */ ) {
+            // See http://www.eclipse.org/jetty/documentation/current/serving-aliased-files.html
+            // Record what would be needed:
+            // 1 - Allow all symbolic links without checking
+            webapp.addAliasCheck(new ContextHandler.ApproveAliases());
+            // 2 - Check links are to valid resources. But default for Unix?
+            webapp.addAliasCheck(new AllowSymLinkAliasChecker()) ;
+        }
         servletContext = webapp.getServletContext() ;
         server.setHandler(webapp) ;
         // Replaced by Shiro.