This is an automated email from the ASF dual-hosted git repository.

psomogyi pushed a commit to branch branch-1.3
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-1.3 by this push:
     new 953537b  HBASE-22070 Checking restoreDir in RestoreSnapshotHelper
953537b is described below

commit 953537b97263edbb64d489b3d29ade11f5ea57e2
Author: chaiwentao <[email protected]>
AuthorDate: Fri Apr 5 23:56:00 2019 +0800

    HBASE-22070 Checking restoreDir in RestoreSnapshotHelper
    
    Signed-off-by: Peter Somogyi <[email protected]>
---
 .../java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
index c34f899..d5517f9 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
@@ -718,7 +718,7 @@ public class RestoreSnapshotHelper {
       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);
     }

Reply via email to