[
https://issues.apache.org/jira/browse/HIVE-27116?focusedWorklogId=849177&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-849177
]
ASF GitHub Bot logged work on HIVE-27116:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Mar/23 04:18
Start Date: 06/Mar/23 04:18
Worklog Time Spent: 10m
Work Description: dengzhhu653 commented on code in PR #4092:
URL: https://github.com/apache/hive/pull/4092#discussion_r1125883742
##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/command/CommandAuthorizerV2.java:
##########
@@ -83,17 +84,16 @@ static void doAuthorization(HiveOperation op,
BaseSemanticAnalyzer sem, SessionS
ss.getAuthorizerV2().checkPrivileges(hiveOpType, inputsHObjs, outputHObjs,
authzContextBuilder.build());
}
- private static void addPermanentFunctionEntities(SessionState ss,
List<ReadEntity> inputList) throws HiveException {
+ private static void addPermanentFunctionEntities(SessionState ss,
List<ReadEntity> inputList, BaseSemanticAnalyzer sem) throws HiveException {
for (Entry<String, FunctionInfo> function :
ss.getCurrentFunctionsInUse().entrySet()) {
if (function.getValue().getFunctionType() != FunctionType.PERSISTENT) {
// Built-in function access is allowed to all users. If user can
create a temp function, they may use it.
continue;
}
String[] qualifiedFunctionName =
FunctionUtils.getQualifiedFunctionNameParts(function.getKey());
- // this is only for the purpose of authorization, only the name matters.
- Database db = new Database(qualifiedFunctionName[0], "", "", null);
- inputList.add(new ReadEntity(db, qualifiedFunctionName[1],
function.getValue().getClassName(), Type.FUNCTION));
+ // For the purpose of authorization, we need to send full function
object.
+ inputList.add(new
ReadEntity(sem.getDb().getFunction(qualifiedFunctionName[0],
qualifiedFunctionName[1])));
Review Comment:
Why we fetch the function here?
Issue Time Tracking
-------------------
Worklog Id: (was: 849177)
Time Spent: 1h 10m (was: 1h)
> HS2 need to send owner info for UDFs in the HivePrivilegeObject for
> authorization
> ---------------------------------------------------------------------------------
>
> Key: HIVE-27116
> URL: https://issues.apache.org/jira/browse/HIVE-27116
> Project: Hive
> Issue Type: Bug
> Components: HiveServer2, Security
> Reporter: Sai Hemanth Gantasala
> Assignee: Sai Hemanth Gantasala
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> UDFs (Functions) of HivePrivilegeObject should have owner info for
> authorization.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)