[v0.12.4]用户与角色UDF权限赋予问题,非root用户查询返回空值时,报错"Msg: 602: No permissions for this operation UDTF"
- 主要语言
- Java
- 星标
- 6.4k
- 派生
- 1.2k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 115
描述
**Describe the bug**
iotdb 0.12.4修复了0.12.2版本中用户与角色UDF权限赋予非root无法正确生效的问题,可参考[Issue-4308](https://github.com/apache/iotdb/issues/4308)。但是当我们使用非root用户进行UDF查询时,如果查询的值不存在,依然报错"Msg: 602: No permissions for this operation UDTF"。这会给用户误导。希望可以在新版本中修复。
**To Reproduce**
Steps to reproduce the behavior:
1. 使用root用户登录sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
2. 创建非root用户并赋权:
CREATE ROLE udtf_test 'udtf_passwd'
CREATE ROLE udtf_test_role
GRANT ROLE udtf_test_role PRIVILEGES 'SET_STORAGE_GROUP','CREATE_TIMESERIES','INSERT_TIMESERIES','READ_TIMESERIES','DELETE_TIMESERIES','DROP_FUNCTION','CREATE_FUNCTION' ON root.test
GRANT udtf_test_role TO udtf_test
3. 使用root用户查询:
select WTUR_PwrAt_Ra_F32 from root.test.20.123456789 where time >= 2021-01-01 and time<= 2021-01-31 23:59:59
+----+
|Time|
+----+
+----+
4. 使用udtf_test用户查询:Msg: 602: No permissions for this operation UDTF。
5. 执行命令,导入数据:
insert into root.test.20.123456789(time, WTUR_PwrAt_Ra_F32) values(1,1)
6. root用户和用户分别使用相同命令查询,得到相同的结果如下:
select WTUR_PwrAt_Ra_F32 from root.test.20.123456789 where time >= 2021-01-01 and time<= 2021-01-31 23:59:59
+----+-----------------------------------------+
|Time|root.test.20.123456789.WTUR_PwrAt_Ra_F32|
+----+-----------------------------------------+
+----+-----------------------------------------+
**Expected behavior**
非root用户查询空表格时,应正确返回空值,而非报权限错误,这会使用户产生误解。
Desktop (please complete the following information):
OS: Amazon Linux
贡献指南
调研方向
使用提供的角色授权和 UDF 查询,通过 sbin/start-cli.sh 复现该报告:先使用空表,然后插入数据后再执行。阅读 Issue-4308 以了解相关的权限处理,并跟踪 UDF 的授权路径。完成的标准是:已授权的非 root 用户收到空结果,而不是误导性的权限错误。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, sql
- 领域
- authorization, databases, security
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100