HBASE-22070 Checking restoreDir in RestoreSnapshotHelper

Signed-off-by: Peter Somogyi <psomogyi@apache.org>
This commit is contained in:
chaiwentao 2019-04-05 23:56:00 +08:00 committed by Peter Somogyi
parent 4562bf608c
commit 5e03efc558
1 changed files with 1 additions and 1 deletions

View File

@ -829,7 +829,7 @@ public class RestoreSnapshotHelper {
throw new IllegalArgumentException("Filesystems for restore directory and HBase root " + throw new IllegalArgumentException("Filesystems for restore directory and HBase root " +
"directory should be the same"); "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 " + throw new IllegalArgumentException("Restore directory cannot be a sub directory of HBase " +
"root directory. RootDir: " + rootDir + ", restoreDir: " + restoreDir); "root directory. RootDir: " + rootDir + ", restoreDir: " + restoreDir);
} }