浏览代码

HUE-2467 [sentry] Check NN plugin prefixes for exact match of subpath

Do not match /user/hive/warehouse3 if prefix is /user/hive/warehouse
Romain Rigaux 11 年之前
父节点
当前提交
94d7717
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      desktop/libs/hadoop/src/hadoop/fs/webhdfs.py

+ 1 - 1
desktop/libs/hadoop/src/hadoop/fs/webhdfs.py

@@ -110,7 +110,7 @@ class WebHdfs(Hdfs):
   def is_sentry_managed(cls, path):
     prefixes = get_nn_sentry_prefixes().split(',')
 
-    return any([path.startswith(p) for p in prefixes if p])
+    return any([path == p or path.startswith(p + '/') for p in prefixes if p])
 
   @property
   def fs_defaultfs(self):