瀏覽代碼

HADOOP-16167. Fixed Hadoop shell script for Ubuntu 18.
Contributed by Daniel Templeton

Eric Yang 6 年之前
父節點
當前提交
5446e3cb8a
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh

+ 12 - 0
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.