You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@orc.apache.org by "Dongjoon Hyun (Jira)" <ji...@apache.org> on 2021/10/24 03:59:00 UTC
[jira] [Resolved] (ORC-1035) `backupDataPath` may be incorrect in
recoverFile
[ https://issues.apache.org/jira/browse/ORC-1035?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dongjoon Hyun resolved ORC-1035.
--------------------------------
Fix Version/s: 1.6.12
1.7.1
1.8.0
Assignee: Yiqun Zhang
Resolution: Fixed
This is resolved via https://github.com/apache/orc/pull/945
> `backupDataPath` may be incorrect in recoverFile
> ------------------------------------------------
>
> Key: ORC-1035
> URL: https://issues.apache.org/jira/browse/ORC-1035
> Project: ORC
> Issue Type: Bug
> Components: Java, tools
> Affects Versions: 1.7.0, 1.8.0, 1.6.11
> Reporter: Yiqun Zhang
> Assignee: Yiqun Zhang
> Priority: Major
> Fix For: 1.8.0, 1.7.1, 1.6.12
>
>
> {code:java}
> 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);
> }
> {code}
> 1. System.getProperty("java.io.tmpdir") gets a path that may or may not end in Path.SEPARATOR, as seen in the [Travis ci|https://app.travis-ci.com/github/apache/orc/jobs/544381649#L1580] 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.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)