maheshk114 commented on a change in pull request #558: HIVE-21325 : Hive 
external table replication failed with Permission denied issue.
URL: https://github.com/apache/hive/pull/558#discussion_r263271098
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/StorageBasedAuthorizationProvider.java
 ##########
 @@ -188,6 +191,17 @@ public void authorize(Table table, Privilege[] 
readRequiredPriv, Privilege[] wri
       checkDeletePermission(path, getConf(), authenticator.getUserName());
     }
 
+    try {
+      String user = SecurityUtils.getUGI().getShortUserName();
+      if (MetaStoreServerUtils.checkUserHasHostProxyPrivileges(user, getConf(),
+              HiveMetaStore.HMSHandler.getIPAddress())) {
+        LOG.info("Path authentication is skipped for user {} with host proxy 
privilege." + user);
+      }
+    } catch (Exception ex) {
+      // if can not decide on the proxy privilege status, then proceed with 
authorization check.
+      LOG.error("Cannot obtain username to check for host proxy privilege", 
ex);
 
 Review comment:
   done

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to