Skip to content

Commit

Permalink
HBASE-22070 Checking restoreDir in RestoreSnapshotHelper
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Somogyi <psomogyi@apache.org>
  • Loading branch information
VincentChoiCN authored and petersomogyi committed Apr 6, 2019
1 parent 72a5238 commit 06d97dc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ public static RestoreMetaChanges copySnapshotForScanner(Configuration conf, File
throw new IllegalArgumentException("Filesystems for restore directory and HBase root directory " +
"should be the same");
}
if (restoreDir.toUri().getPath().startsWith(rootDir.toUri().getPath())) {
if (restoreDir.toUri().getPath().startsWith(rootDir.toUri().getPath() +"/")) {
throw new IllegalArgumentException("Restore directory cannot be a sub directory of HBase " +
"root directory. RootDir: " + rootDir + ", restoreDir: " + restoreDir);
}
Expand Down

0 comments on commit 06d97dc

Please sign in to comment.