You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ps...@apache.org on 2019/04/06 14:12:27 UTC

[hbase] branch branch-2.2 updated: HBASE-22070 Checking restoreDir in RestoreSnapshotHelper

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

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


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

commit 67b312bb02a87119c1f1b7a49bfb32be5ddfe524
Author: chaiwentao <we...@live.com>
AuthorDate: Fri Apr 5 23:56:00 2019 +0800

    HBASE-22070 Checking restoreDir in RestoreSnapshotHelper
    
    Signed-off-by: Peter Somogyi <ps...@apache.org>
---
 .../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 ec251b8..f533af4 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
@@ -829,7 +829,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);
     }