From 5446e3cb8a4d9b6aa517fc8437ba194a9ae9b193 Mon Sep 17 00:00:00 2001 From: Eric Yang Date: Mon, 18 Mar 2019 13:04:49 -0400 Subject: [PATCH] HADOOP-16167. Fixed Hadoop shell script for Ubuntu 18. Contributed by Daniel Templeton --- .../hadoop-common/src/main/bin/hadoop-functions.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh index 71ba7fffc1..e291a9b899 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh @@ -2364,6 +2364,10 @@ function hadoop_verify_user_perm declare command=$2 declare uvar + if [[ ${command} =~ \. ]]; then + return 1 + fi + uvar=$(hadoop_build_custom_subcmd_var "${program}" "${command}" USER) if [[ -n ${!uvar} ]]; then @@ -2395,6 +2399,10 @@ function hadoop_need_reexec return 1 fi + if [[ ${command} =~ \. ]]; then + return 1 + fi + # if we have privilege, and the _USER is defined, and _USER is # set to someone who isn't us, then yes, we should re-exec. # otherwise no, don't re-exec and let the system deal with it. @@ -2431,6 +2439,10 @@ function hadoop_subcommand_opts return 1 fi + if [[ ${command} =~ \. ]]; then + return 1 + fi + # bash 4 and up have built-in ways to upper and lower # case the contents of vars. This is faster than # calling tr.