hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sze...@apache.org
Subject [07/44] hive git commit: HIVE-9803 - SparkClientImpl should not attempt impersonation in CLI mode [Spark Branch] (Brock via Chao)
Date Thu, 23 Apr 2015 02:34:16 GMT
HIVE-9803 - SparkClientImpl should not attempt impersonation in CLI mode [Spark Branch] (Brock
via Chao)

git-svn-id: https://svn.apache.org/repos/asf/hive/branches/spark@1662841 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/0c76a7ba
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/0c76a7ba
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/0c76a7ba

Branch: refs/heads/master
Commit: 0c76a7ba516fc0dafbffec92757679d475badc7e
Parents: 81a7433
Author: Brock Noland <brock@apache.org>
Authored: Fri Feb 27 22:49:29 2015 +0000
Committer: Szehon Ho <szehon@cloudera.com>
Committed: Wed Apr 22 19:33:49 2015 -0700

----------------------------------------------------------------------
 .../org/apache/hive/spark/client/SparkClientImpl.java    | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/0c76a7ba/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
----------------------------------------------------------------------
diff --git a/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
b/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
index ba08106..727ad29 100644
--- a/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
+++ b/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
@@ -352,9 +352,14 @@ class SparkClientImpl implements SparkClient {
       }
 
       if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ENABLE_DOAS)) {
-        argv.add("--proxy-user");
         try {
-          argv.add(Utils.getUGI().getShortUserName());
+          String currentUser = Utils.getUGI().getShortUserName();
+          // do not do impersonation in CLI mode
+          if (!currentUser.equals(System.getProperty("user.name"))) {
+            LOG.info("Attempting impersonation of " + currentUser);
+            argv.add("--proxy-user");
+            argv.add(currentUser);
+          }
         } catch (Exception e) {
           String msg = "Cannot obtain username: " + e;
           throw new IllegalStateException(msg, e);
@@ -385,7 +390,7 @@ class SparkClientImpl implements SparkClient {
         argv.add(String.format("%s=%s", hiveSparkConfKey, value));
       }
 
-      LOG.debug("Running client driver with argv: {}", Joiner.on(" ").join(argv));
+      LOG.info("Running client driver with argv: {}", Joiner.on(" ").join(argv));
 
       ProcessBuilder pb = new ProcessBuilder(argv.toArray(new String[argv.size()]));
       if (isTesting != null) {


Mime
View raw message