Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.8 1795ed427 -> 637612276


ZEPPELIN-3395 Fix impersonate spark interpreter without proxy-user option

### What is this PR for?
Fix impersonate spark interpreter.
Currently, impersonate spark interpreter always runs as zeppelin user, not 
impersonated user when disable proxy-user option.

### What type of PR is it?
Bug Fix

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-3395

### How should this be tested?
1. ZEPPELIN_IMPERSONATE_SPARK_PROXY_USER=false in zeppelin-env.sh
2. set up user impersonation flag
3. run some job using that spark interpreter
4. spark interpreter process should be created with currently logged-in user

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: iijima_satoshi <iijima_sato...@cyberagent.co.jp>

Closes #2916 from iijima-satoshi/fix-impersonate-spark and squashes the 
following commits:

a7465b6 [iijima_satoshi] Fix: Spark interpreter does not run as impersonated 
user when disable proxy-user option

(cherry picked from commit aa3ea6869f336f7a09e6a57bd2882216d010955d)
Signed-off-by: Jeff Zhang <zjf...@apache.org>


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

Branch: refs/heads/branch-0.8
Commit: 6376122761bd5bca984d6783b947b7f1a9637252
Parents: 1795ed4
Author: iijima_satoshi <iijima_sato...@cyberagent.co.jp>
Authored: Mon Apr 9 21:24:34 2018 +0900
Committer: Jeff Zhang <zjf...@apache.org>
Committed: Mon Apr 16 17:01:36 2018 +0800

----------------------------------------------------------------------
 bin/interpreter.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/63761227/bin/interpreter.sh
----------------------------------------------------------------------
diff --git a/bin/interpreter.sh b/bin/interpreter.sh
index 45ee0ce..a8375af 100755
--- a/bin/interpreter.sh
+++ b/bin/interpreter.sh
@@ -205,7 +205,8 @@ fi
 
 addJarInDirForIntp "${LOCAL_INTERPRETER_REPO}"
 
-if [[ ! -z "$ZEPPELIN_IMPERSONATE_USER" && "${INTERPRETER_ID}" != "spark" ]]; 
then
+if [[ ! -z "$ZEPPELIN_IMPERSONATE_USER" ]]; then
+  if [[ "${INTERPRETER_ID}" != "spark" || 
"$ZEPPELIN_IMPERSONATE_SPARK_PROXY_USER" == "false" ]]; then
     suid="$(id -u ${ZEPPELIN_IMPERSONATE_USER})"
     if [[ -n  "${suid}" || -z "${SPARK_SUBMIT}" ]]; then
        INTERPRETER_RUN_COMMAND=${ZEPPELIN_IMPERSONATE_RUN_CMD}" '"
@@ -213,6 +214,7 @@ if [[ ! -z "$ZEPPELIN_IMPERSONATE_USER" && 
"${INTERPRETER_ID}" != "spark" ]]; th
            INTERPRETER_RUN_COMMAND+=" source 
"${ZEPPELIN_CONF_DIR}'/zeppelin-env.sh;'
        fi
     fi
+  fi
 fi
 
 if [[ -n "${SPARK_SUBMIT}" ]]; then

Reply via email to