hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From open...@apache.org
Subject [hbase] 08/14: HBASE-22070 Checking restoreDir in RestoreSnapshotHelper
Date Mon, 08 Apr 2019 07:45:57 GMT
This is an automated email from the ASF dual-hosted git repository.

openinx pushed a commit to branch HBASE-21879
in repository https://gitbox.apache.org/repos/asf/hbase.git

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

    HBASE-22070 Checking restoreDir in RestoreSnapshotHelper
    
    Signed-off-by: Peter Somogyi <psomogyi@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);
     }


Mime
View raw message