drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From parthchandra <...@git.apache.org>
Subject [GitHub] drill pull request #1050: DRILL-5964: Do not allow queries to access paths o...
Date Mon, 27 Nov 2017 20:51:12 GMT
Github user parthchandra commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1050#discussion_r152862693
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java
---
    @@ -359,15 +363,30 @@ private static Path handleWildCard(final String root) {
         }
       }
     
    -  private static String removeLeadingSlash(String path) {
    -    if (path.charAt(0) == '/') {
    +  public static String removeLeadingSlash(String path) {
    +    if (!path.isEmpty() && path.charAt(0) == '/') {
           String newPath = path.substring(1);
           return removeLeadingSlash(newPath);
         } else {
           return path;
         }
       }
     
    +  // Check if the path is a valid sub path under the parent after removing backpaths.
Throw an exception if
    +  // it is not
    +  // We pass subpath in as a parameter only for the error message
    +  public static boolean checkBackPaths(String parent, String combinedPath, String subpath)
{
    --- End diff --
    
    Done


---

Mime
View raw message