You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/02/19 18:04:56 UTC

[GitHub] [hive] sankarh commented on a change in pull request #1964: [WIP]HIVE-24751: Add authorization flag check for KillQueryImpl

sankarh commented on a change in pull request #1964:
URL: https://github.com/apache/hive/pull/1964#discussion_r579374650



##########
File path: service/src/java/org/apache/hive/service/server/KillQueryImpl.java
##########
@@ -116,9 +117,21 @@ public static void killChildYarnJobs(Configuration conf, String tag, String doAs
 
   private static boolean isAdmin() {
     boolean isAdmin = false;
-    if (SessionState.get().getAuthorizerV2() != null) {
+    SessionState ss = SessionState.get();
+    if(!HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)) {
+      // If authorization is disabled, hs2 process owner should have kill privileges
       try {
-        SessionState.get().getAuthorizerV2()
+        String currentUser = ss.getUserName();

Review comment:
       Can we try and add an unit test that hits this flow (if not already exist)?

##########
File path: service/src/java/org/apache/hive/service/server/KillQueryImpl.java
##########
@@ -116,9 +117,21 @@ public static void killChildYarnJobs(Configuration conf, String tag, String doAs
 
   private static boolean isAdmin() {
     boolean isAdmin = false;
-    if (SessionState.get().getAuthorizerV2() != null) {
+    SessionState ss = SessionState.get();
+    if(!HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)) {
+      // If authorization is disabled, hs2 process owner should have kill privileges
       try {
-        SessionState.get().getAuthorizerV2()
+        String currentUser = ss.getUserName();

Review comment:
       Can we try and add a unit test that hits this flow (if not already exist)?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org