Uploaded image for project: 'ORC'
  1. ORC
  2. ORC-1035

`backupDataPath` may be incorrect in recoverFile

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.0, 1.6.11
    • 1.7.1, 1.6.12
    • Java, tools
    • None

    Description

            public static final String DEFAULT_BACKUP_PATH = System.getProperty("java.io.tmpdir");
            ......
            String scheme = corruptPath.toUri().getScheme();
            String authority = corruptPath.toUri().getAuthority();
            String filePath = corruptPath.toUri().getPath();
            if (backup.equals(DEFAULT_BACKUP_PATH)) {
              backupDataPath = new Path(scheme, authority, DEFAULT_BACKUP_PATH + filePath);
            } else {
              backupDataPath = Path.mergePaths(new Path(backup), corruptPath);
            }
      

      1.  System.getProperty("java.io.tmpdir") gets a path that may or may not end in Path.SEPARATOR, as seen in the Travis ci example, the path generated directly by DEFAULT_BACKUP_PATH + filePath may not be correct.

       

      2. corruptPath is the path entered by the user, which may be absolute or relative. The second argument of Path.mergePaths is expected to be a path starting with Path.SEPARATOR, so when the user enters a relative path, Path.mergePaths(new Path(backup), corruptPath) the result is also incorrect.

       

      Attachments

        Issue Links

          Activity

            People

              Guiyankuang Yiqun Zhang
              Guiyankuang Yiqun Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: